Class: Fictive::Passage

Inherits:
Object
  • Object
show all
Defined in:
lib/fictive/passage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject (readonly)

Returns the value of attribute text.



3
4
5
# File 'lib/fictive/passage.rb', line 3

def text
  @text
end

Instance Method Details

#choicesObject



14
15
16
# File 'lib/fictive/passage.rb', line 14

def choices
  @metadata.fetch(:choices, [])
end

#idObject



10
11
12
# File 'lib/fictive/passage.rb', line 10

def id
  @metadata.fetch(:id)
end