Class: Fountain::Field
- Inherits:
-
Object
- Object
- Fountain::Field
- Defined in:
- lib/fountain/field.rb
Overview
Fountain Field
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Raw field data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Field
constructor
A new instance of Field.
- #inspect ⇒ Object
-
#key ⇒ Object
Key.
-
#question ⇒ Object
Question.
-
#type ⇒ Object
Type.
Constructor Details
#initialize(data) ⇒ Field
Returns a new instance of Field.
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_data ⇒ Object (readonly)
Raw field data
9 10 11 |
# File 'lib/fountain/field.rb', line 9 def raw_data @raw_data end |
Instance Method Details
#inspect ⇒ Object
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 |
#key ⇒ Object
Key
29 30 31 |
# File 'lib/fountain/field.rb', line 29 def key raw_data['key'] end |
#question ⇒ Object
Question
19 20 21 |
# File 'lib/fountain/field.rb', line 19 def question raw_data['question'] end |
#type ⇒ Object
Type
24 25 26 |
# File 'lib/fountain/field.rb', line 24 def type raw_data['type'] end |