Class: Fino::Definition::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/fino/definition/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, **options) ⇒ Section

Returns a new instance of Section.



6
7
8
9
# File 'lib/fino/definition/section.rb', line 6

def initialize(name:, **options)
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/fino/definition/section.rb', line 4

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/fino/definition/section.rb', line 4

def options
  @options
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


15
16
17
# File 'lib/fino/definition/section.rb', line 15

def eql?(other)
  self.class.eql?(other.class) && name == other.name
end

#hashObject



20
21
22
# File 'lib/fino/definition/section.rb', line 20

def hash
  name.hash
end

#labelObject



11
12
13
# File 'lib/fino/definition/section.rb', line 11

def label
  options.fetch(:label, name.to_s.capitalize)
end