Class: Fountain::Slot

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

Overview

Fountain Slot

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Slot

Returns a new instance of Slot.

Parameters:

  • data (Hash)

    Raw slot data



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

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

Instance Attribute Details

#raw_dataObject (readonly)

Raw slot data



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

def raw_data
  @raw_data
end

Instance Method Details

#end_timeObject

End time



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

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

#idObject

Slot ID



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

def id
  raw_data['id']
end

#inspectObject



53
54
55
56
57
58
59
60
# File 'lib/fountain/slot.rb', line 53

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

#instructionsObject

Instructions



44
45
46
# File 'lib/fountain/slot.rb', line 44

def instructions
  raw_data['instructions']
end

#locationObject

Location



34
35
36
# File 'lib/fountain/slot.rb', line 34

def location
  raw_data['location']
end

#recruiterObject

Recruiter



39
40
41
# File 'lib/fountain/slot.rb', line 39

def recruiter
  raw_data['recruiter']
end

#showed_up?Boolean

Showed up

Returns:

  • (Boolean)


49
50
51
# File 'lib/fountain/slot.rb', line 49

def showed_up?
  raw_data['showed_up'].to_s == 'true'
end

#start_timeObject

Start time



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

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