Class: ActiveForms::Application

Inherits:
Mapper
  • Object
show all
Defined in:
lib/active_forms/application.rb

Instance Attribute Summary

Attributes inherited from Mapper

#attributes

Class Method Summary collapse

Methods inherited from Mapper

#==, #apiVersion=, #initialize, #xmlns=

Constructor Details

This class inherits a constructor from ActiveForms::Mapper

Class Method Details

.all(params = {}) ⇒ Object

required params:

apiStatus = sent | saved | sent_to_be


7
8
9
10
11
12
13
14
# File 'lib/active_forms/application.rb', line 7

def all(params = {})
  response = ActiveForms::Request.get("applications", params)

  hashes = response["applications"]["application"]
  hashes = [hashes] if hashes.is_a?(Hash)

  objects = hashes.map { |attributes| new(attributes) }
end

.find(params = {}) ⇒ Object

required params:

apiFormCode - Form's code
apiNumber   - Application's number


19
20
21
22
23
24
25
# File 'lib/active_forms/application.rb', line 19

def find(params = {})
  response = ActiveForms::Request.get("applicationdata", params)

  attributes = response["applicationData"]

  new(attributes)
end