Class: MoreappAPI::Folder

Inherits:
Object
  • Object
show all
Defined in:
lib/moreapp_api/folder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(customer, data) ⇒ Folder

Returns a new instance of Folder.



8
9
10
11
12
13
14
15
# File 'lib/moreapp_api/folder.rb', line 8

def initialize(customer, data)
  @moreapp_api = customer.moreapp_api
  @customer = customer
  @id = data["applicationId"]
  @name = data["name"]
  @form_ids = data["forms"]
  @raw_data = data
end

Instance Attribute Details

#customerObject

Returns the value of attribute customer.



6
7
8
# File 'lib/moreapp_api/folder.rb', line 6

def customer
  @customer
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/moreapp_api/folder.rb', line 6

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/moreapp_api/folder.rb', line 6

def name
  @name
end

#raw_dataObject

Returns the value of attribute raw_data.



6
7
8
# File 'lib/moreapp_api/folder.rb', line 6

def raw_data
  @raw_data
end

Instance Method Details

#formsObject



17
18
19
20
21
# File 'lib/moreapp_api/folder.rb', line 17

def forms
  @form_ids.map do |long_form_id|
    MoreappAPI::Form.create_in_folder(self, long_form_id)
  end
end