Class: TTY::Option::Section
- Inherits:
-
Object
- Object
- TTY::Option::Section
- Defined in:
- lib/tty/option/section.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(name, content = []) ⇒ Section
constructor
A new instance of Section.
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, content = []) ⇒ Section
Returns a new instance of Section.
8 9 10 11 |
# File 'lib/tty/option/section.rb', line 8 def initialize(name, content = []) @name = name @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
6 7 8 |
# File 'lib/tty/option/section.rb', line 6 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/tty/option/section.rb', line 6 def name @name end |
Instance Method Details
#empty? ⇒ Boolean
17 18 19 |
# File 'lib/tty/option/section.rb', line 17 def empty? content.empty? end |
#to_a ⇒ Object
13 14 15 |
# File 'lib/tty/option/section.rb', line 13 def to_a [name, content] end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/tty/option/section.rb', line 21 def to_s content end |