Class: Config::Section

Inherits:
Struct
  • Object
show all
Defined in:
lib/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



21
22
23
# File 'lib/config.rb', line 21

def name
  @name
end

Class Method Details

.normalize(name) ⇒ Object



22
23
24
25
# File 'lib/config.rb', line 22

def self.normalize(name)
  return [] if name.empty?
  [name.first.downcase, name.drop(1).join(".")]
end

Instance Method Details

#headling_lineObject



27
28
29
30
31
# File 'lib/config.rb', line 27

def headling_line
  line = "[#{ name.first }"
  line.concat(%' "#{ name.drop(1).join(".") }"') if name.size > 1
  line.concat("]\n")
end