Class: Fountain::Stage

Inherits:
Object
  • Object
show all
Defined in:
lib/fountain/stage.rb

Overview

Fountain Stage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Stage

Returns a new instance of Stage.

Parameters:

  • data (Hash)

    Raw stage data



14
15
16
# File 'lib/fountain/stage.rb', line 14

def initialize(data)
  @raw_data = Util.stringify_hash_keys data
end

Instance Attribute Details

#raw_dataObject (readonly)

Raw stage data



9
10
11
# File 'lib/fountain/stage.rb', line 9

def raw_data
  @raw_data
end

Instance Method Details

#idObject

Stage ID



19
20
21
# File 'lib/fountain/stage.rb', line 19

def id
  raw_data['id']
end

#inspectObject



33
34
35
36
37
38
39
40
41
# File 'lib/fountain/stage.rb', line 33

def inspect
  format(
    '#<%<class_name>s:0x%<object_id>p @id="%<id>s" @title="%<title>s">',
    class_name: self.class.name,
    object_id: object_id,
    id: id,
    title: title
  )
end

#titleObject

Title



24
25
26
# File 'lib/fountain/stage.rb', line 24

def title
  raw_data['title']
end

#typeObject

Type



29
30
31
# File 'lib/fountain/stage.rb', line 29

def type
  raw_data['type']
end