Class: Chordproko::Directive

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Directive

Returns a new instance of Directive.



8
9
10
11
# File 'lib/chordproko/directive.rb', line 8

def initialize key, value
  @key = key
  @value = value
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/chordproko/directive.rb', line 3

def key
  @key
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/chordproko/directive.rb', line 3

def value
  @value
end

Instance Method Details

#each(&block) ⇒ Object



5
6
7
# File 'lib/chordproko/directive.rb', line 5

def each(&block)
	[self].each(&block)
end

#to_sObject



12
13
14
# File 'lib/chordproko/directive.rb', line 12

def to_s
  "#{@key.to_s.capitalize}: #{@value}"
end