Module: Puppet_X::EnterpriseModules::WebLogic::TitleParser

Defined in:
lib/puppet_x/enterprisemodules/weblogic/title_parser.rb

Instance Method Summary collapse

Instance Method Details

#add_title_attributes(*attributes, &proc) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/puppet_x/enterprisemodules/weblogic/title_parser.rb', line 10

def add_title_attributes(*attributes, &proc)
  base_regexp = proc ? yield : /(.+)/
  without_domain_regexp = Regexp.new("^(#{base_regexp.source})$")
  with_domain_regexp    = Regexp.new("^((.+)/#{base_regexp.source})$")
  map_titles_to_attributes([
                             with_domain_regexp, [:name] + [:domain] + attributes,
                             without_domain_regexp, [:name] + attributes
                           ])
end