Class: Pslm::Psalm::Verse
- Inherits:
-
Object
- Object
- Pslm::Psalm::Verse
- Defined in:
- lib/pslm/psalm.rb
Instance Attribute Summary collapse
-
#first ⇒ Object
Returns the value of attribute first.
-
#flex ⇒ Object
Returns the value of attribute flex.
-
#second ⇒ Object
Returns the value of attribute second.
Instance Method Summary collapse
- #==(v2) ⇒ Object
-
#initialize(flex = nil, first = nil, second = nil) ⇒ Verse
constructor
A new instance of Verse.
- #parts ⇒ Object
Constructor Details
#initialize(flex = nil, first = nil, second = nil) ⇒ Verse
Returns a new instance of Verse.
60 61 62 63 64 65 66 67 |
# File 'lib/pslm/psalm.rb', line 60 def initialize(flex=nil, first=nil, second=nil) @flex = flex @first = first @second = second if second.nil? then yield self end end |
Instance Attribute Details
#first ⇒ Object
Returns the value of attribute first.
69 70 71 |
# File 'lib/pslm/psalm.rb', line 69 def first @first end |
#flex ⇒ Object
Returns the value of attribute flex.
69 70 71 |
# File 'lib/pslm/psalm.rb', line 69 def flex @flex end |
#second ⇒ Object
Returns the value of attribute second.
69 70 71 |
# File 'lib/pslm/psalm.rb', line 69 def second @second end |
Instance Method Details
#==(v2) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/pslm/psalm.rb', line 77 def ==(v2) unless v2.is_a? Verse return false end [:flex, :first, :second].each do |part| if self.send(part) != v2.send(part) then return false end end return true end |
#parts ⇒ Object
71 72 73 74 75 |
# File 'lib/pslm/psalm.rb', line 71 def parts r = [@first, @second] r.unshift @flex if @flex return r end |