Module: StepUp::ConfigSectionsExt
- Defined in:
- lib/step-up/config.rb
Instance Method Summary collapse
- #label(section) ⇒ Object
- #labels ⇒ Object
- #names ⇒ Object
- #prefixes ⇒ Object
- #tag(section) ⇒ Object
- #tags ⇒ Object
Instance Method Details
#label(section) ⇒ Object
34 35 36 |
# File 'lib/step-up/config.rb', line 34 def label(section) labels[names.index(section)] end |
#labels ⇒ Object
26 27 28 |
# File 'lib/step-up/config.rb', line 26 def labels map{ |section| section.is_a?(String) ? to_label(section) : (section["label"] || to_label(section["name"])) } end |
#names ⇒ Object
18 19 20 |
# File 'lib/step-up/config.rb', line 18 def names map{ |section| section.is_a?(String) ? section : section["name"] } end |
#prefixes ⇒ Object
22 23 24 |
# File 'lib/step-up/config.rb', line 22 def prefixes map{ |section| section.is_a?(String) ? to_prefix(section) : (section["prefix"] || to_prefix(section["name"])) } end |
#tag(section) ⇒ Object
38 39 40 |
# File 'lib/step-up/config.rb', line 38 def tag(section) [names.index(section)] end |
#tags ⇒ Object
30 31 32 |
# File 'lib/step-up/config.rb', line 30 def map{ |section| section.is_a?(String) ? to_tag(section) : (section["tag"] || to_tag(section["name"])) } end |