Class: Fictive::Passage
- Inherits:
-
Object
- Object
- Fictive::Passage
- Defined in:
- lib/fictive/passage.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #choices ⇒ Object
- #id ⇒ Object
-
#initialize(metadata, text) ⇒ Passage
constructor
A new instance of Passage.
Constructor Details
#initialize(metadata, text) ⇒ Passage
Returns a new instance of Passage.
5 6 7 8 |
# File 'lib/fictive/passage.rb', line 5 def initialize(, text) @metadata = @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/fictive/passage.rb', line 3 def text @text end |
Instance Method Details
#choices ⇒ Object
14 15 16 |
# File 'lib/fictive/passage.rb', line 14 def choices @metadata.fetch(:choices, []) end |
#id ⇒ Object
10 11 12 |
# File 'lib/fictive/passage.rb', line 10 def id @metadata.fetch(:id) end |