Class: ProcessOut::Project
- Inherits:
-
Object
- Object
- ProcessOut::Project
- Defined in:
- lib/processout/project.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#logo_url ⇒ Object
Returns the value of attribute logo_url.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#fill_with_data(data) ⇒ Object
- Fills the object with data coming from the API Params:
data -
Hashof data coming from the API.
- Fills the object with data coming from the API Params:
-
#gateway_configurations(options = nil) ⇒ Object
- Get all the gateway configurations of the project Params:
options -
Hashof options.
- Get all the gateway configurations of the project Params:
-
#initialize(client) ⇒ Project
constructor
- Initializes the Project object Params:
client -
ProcessOutclient instance.
- Initializes the Project object Params:
Constructor Details
#initialize(client) ⇒ Project
Initializes the Project object Params:
client-
ProcessOutclient instance
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/processout/project.rb', line 41 def initialize(client) @client = client @id = "" @name = "" @logo_url = "" @email = "" @created_at = "" end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
14 15 16 |
# File 'lib/processout/project.rb', line 14 def created_at @created_at end |
#email ⇒ Object
Returns the value of attribute email.
13 14 15 |
# File 'lib/processout/project.rb', line 13 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/processout/project.rb', line 10 def id @id end |
#logo_url ⇒ Object
Returns the value of attribute logo_url.
12 13 14 |
# File 'lib/processout/project.rb', line 12 def logo_url @logo_url end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/processout/project.rb', line 11 def name @name end |
Instance Method Details
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data-
Hashof data coming from the API
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/processout/project.rb', line 55 def fill_with_data(data) if data.include? "id" @id = data["id"] end if data.include? "name" @name = data["name"] end if data.include? "logo_url" @logo_url = data["logo_url"] end if data.include? "email" @email = data["email"] end if data.include? "created_at" @created_at = data["created_at"] end self end |
#gateway_configurations(options = nil) ⇒ Object
Get all the gateway configurations of the project Params:
options-
Hashof options
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/processout/project.rb', line 78 def gateway_configurations( = nil) request = Request.new(@client) path = "/projects/" + CGI.escape(@id) + "/gateway-configurations" data = { } response = Response.new(request.get(path, data, )) return_values = Array.new a = Array.new body = response.body for v in body['gateway_configurations'] tmp = GatewayConfiguration(@client) tmp.fill_with_data(v) a.push(tmp) end return_values.push(a) return_values[0] end |