Class: Fountain::Field

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

Overview

Fountain Field

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Field

Returns a new instance of Field.

Parameters:

  • data (Hash)

    Raw field data



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

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

Instance Attribute Details

#raw_dataObject (readonly)

Raw field data



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

def raw_data
  @raw_data
end

Instance Method Details

#inspectObject



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

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

#keyObject

Key



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

def key
  raw_data['key']
end

#questionObject

Question



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

def question
  raw_data['question']
end

#typeObject

Type



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

def type
  raw_data['type']
end