Class: TTY::Option::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/tty/option/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject

Returns the value of attribute content.



6
7
8
# File 'lib/tty/option/section.rb', line 6

def content
  @content
end

#nameObject

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

Returns:

  • (Boolean)


17
18
19
# File 'lib/tty/option/section.rb', line 17

def empty?
  content.empty?
end

#to_aObject



13
14
15
# File 'lib/tty/option/section.rb', line 13

def to_a
  [name, content]
end

#to_sObject



21
22
23
# File 'lib/tty/option/section.rb', line 21

def to_s
  content
end