Class: CSKit::Parsers::Bible::Positional
- Inherits:
-
Struct
- Object
- Struct
- CSKit::Parsers::Bible::Positional
- Defined in:
- lib/cskit/parsers/bible/bible_parser.rb
Instance Attribute Summary collapse
-
#cardinality ⇒ Object
Returns the value of attribute cardinality.
-
#fragment ⇒ Object
Returns the value of attribute fragment.
Instance Method Summary collapse
Instance Attribute Details
#cardinality ⇒ Object
Returns the value of attribute cardinality
58 59 60 |
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 58 def cardinality @cardinality end |
#fragment ⇒ Object
Returns the value of attribute fragment
58 59 60 |
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 58 def fragment @fragment end |
Instance Method Details
#to_hash ⇒ Object
73 74 75 76 77 78 |
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 73 def to_hash { cardinality: cardinality, fragment: fragment } end |
#to_s ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cskit/parsers/bible/bible_parser.rb', line 59 def to_s card_s = case cardinality when 1 then '1st' when 2 then '2nd' when 3 then '3rd' end if cardinality "#{card_s} #{fragment}" else fragment end end |