Class: Chordproko::Directive
- Inherits:
-
Object
- Object
- Chordproko::Directive
- Defined in:
- lib/chordproko/directive.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(key, value) ⇒ Directive
constructor
A new instance of Directive.
- #to_s ⇒ Object
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
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/chordproko/directive.rb', line 3 def key @key end |
#value ⇒ Object
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_s ⇒ Object
12 13 14 |
# File 'lib/chordproko/directive.rb', line 12 def to_s "#{@key.to_s.capitalize}: #{@value}" end |