Class: Formio::Form
- Inherits:
-
Object
- Object
- Formio::Form
- Defined in:
- lib/formio/form.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#formio_hash ⇒ Object
Returns the value of attribute formio_hash.
-
#formio_id ⇒ Object
Returns the value of attribute formio_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(formio_hash) ⇒ Form
constructor
A new instance of Form.
- #to_json ⇒ Object
Constructor Details
#initialize(formio_hash) ⇒ Form
Returns a new instance of Form.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/formio/form.rb', line 15 def initialize(formio_hash) @formio_hash = formio_hash @type = formio_hash['type'] @formio_id = formio_hash['_id'] @components = formio_hash['components'] @name = @title = formio_hash['title'] @path = formio_hash['path'] @created_at = DateTime.parse formio_hash['created'] @updated_at = DateTime.parse formio_hash['modified'] end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def components @components end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def created_at @created_at end |
#formio_hash ⇒ Object
Returns the value of attribute formio_hash.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def formio_hash @formio_hash end |
#formio_id ⇒ Object
Returns the value of attribute formio_id.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def formio_id @formio_id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def path @path end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def type @type end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def updated_at @updated_at end |
Instance Method Details
#to_json ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/formio/form.rb', line 34 def to_json { title: title, display: 'form', type: type, name: name, path: path, components: components, }.to_json end |