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.
-
#submission_access ⇒ Object
Returns the value of attribute submission_access.
-
#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
- #id ⇒ Object
-
#initialize(formio_hash) ⇒ Form
constructor
A new instance of Form.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(formio_hash) ⇒ Form
Returns a new instance of Form.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/formio/form.rb', line 16 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'] @submission_access = formio_hash['submissionAccess'] 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 |
#submission_access ⇒ Object
Returns the value of attribute submission_access.
3 4 5 |
# File 'lib/formio/form.rb', line 3 def submission_access @submission_access 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
#id ⇒ Object
36 37 38 |
# File 'lib/formio/form.rb', line 36 def id formio_hash['_id'] end |
#to_h ⇒ Object
40 41 42 |
# File 'lib/formio/form.rb', line 40 def to_h formio_hash end |
#to_json ⇒ Object
44 45 46 |
# File 'lib/formio/form.rb', line 44 def to_json to_h.to_json end |