class Formio::Form

Attributes

components[RW]
created_at[RW]
formio_hash[RW]
formio_id[RW]
name[RW]
path[RW]
submission_access[RW]
title[RW]
type[RW]
updated_at[RW]

Public Class Methods

new(formio_hash) click to toggle source
# 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

Public Instance Methods

id() click to toggle source
# File lib/formio/form.rb, line 36
def id
  formio_hash['_id']
end
name=(name) click to toggle source
# File lib/formio/form.rb, line 28
def name=(name)
  @name = @title = name
end
title=(title) click to toggle source
# File lib/formio/form.rb, line 32
def title=(title)
  @name = @title = title
end
to_h() click to toggle source
# File lib/formio/form.rb, line 40
def to_h
  formio_hash
end
to_json() click to toggle source
# File lib/formio/form.rb, line 44
def to_json
  to_h.to_json
end