Class: Chordpro::Directive::Name

Inherits:
Object
  • Object
show all
Defined in:
lib/chordpro/directive.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, aka: nil, meta: false) ⇒ Name

Returns a new instance of Name.



6
7
8
# File 'lib/chordpro/directive.rb', line 6

def initialize(name, aka: nil, meta: false)
  @name, @aka, @meta = name, aka, meta
end

Instance Attribute Details

#akaObject (readonly)

Returns the value of attribute aka.



4
5
6
# File 'lib/chordpro/directive.rb', line 4

def aka
  @aka
end

#metaObject (readonly)

Returns the value of attribute meta.



4
5
6
# File 'lib/chordpro/directive.rb', line 4

def meta
  @meta
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
# File 'lib/chordpro/directive.rb', line 14

def ==(other)
  to_s == other.to_s || (aka && aka == other.to_s)
end

#to_sObject



10
11
12
# File 'lib/chordpro/directive.rb', line 10

def to_s
  @name
end