Class: Fountain::Transition

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

Overview

Fountain Transition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Transition

Returns a new instance of Transition.

Parameters:

  • data (Hash)

    Raw transition data



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

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

Instance Attribute Details

#raw_dataObject (readonly)

Raw transition data



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

def raw_data
  @raw_data
end

Instance Method Details

#created_atObject

Created at



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

def created_at
  Time.parse raw_data['created_at']
end

#inspectObject



28
29
30
31
32
33
34
35
# File 'lib/fountain/transition.rb', line 28

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

#stage_titleObject

Stage title



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

def stage_title
  raw_data['stage_title']
end