Class: ProcessOut::Gateway
- Inherits:
-
Object
- Object
- ProcessOut::Gateway
- Defined in:
- lib/processout/gateway.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#flows ⇒ Object
Returns the value of attribute flows.
-
#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.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#url ⇒ Object
Returns the value of attribute url.
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:
-
#initialize(client, data = {}) ⇒ Gateway
constructor
- Initializes the Gateway object Params:
client ProcessOutclient instancedata-
data that can be used to fill the object.
- Initializes the Gateway object Params:
-
#new(data = {}) ⇒ Object
Create a new Gateway using the current client.
-
#prefill(data) ⇒ Object
- Prefills the object with the data passed as parameters Params:
data -
Hashof data.
- Prefills the object with the data passed as parameters Params:
Constructor Details
#initialize(client, data = {}) ⇒ Gateway
Initializes the Gateway object Params:
client-
ProcessOutclient instance data-
data that can be used to fill the object
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/processout/gateway.rb', line 57 def initialize(client, data = {}) @client = client self.id = data.fetch(:id, nil) self.name = data.fetch(:name, nil) self.display_name = data.fetch(:display_name, nil) self.logo_url = data.fetch(:logo_url, nil) self.url = data.fetch(:url, nil) self.flows = data.fetch(:flows, nil) self. = data.fetch(:tags, nil) self.description = data.fetch(:description, nil) end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
17 18 19 |
# File 'lib/processout/gateway.rb', line 17 def description @description end |
#display_name ⇒ Object
Returns the value of attribute display_name.
12 13 14 |
# File 'lib/processout/gateway.rb', line 12 def display_name @display_name end |
#flows ⇒ Object
Returns the value of attribute flows.
15 16 17 |
# File 'lib/processout/gateway.rb', line 15 def flows @flows end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/processout/gateway.rb', line 10 def id @id end |
#logo_url ⇒ Object
Returns the value of attribute logo_url.
13 14 15 |
# File 'lib/processout/gateway.rb', line 13 def logo_url @logo_url end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/processout/gateway.rb', line 11 def name @name end |
#tags ⇒ Object
Returns the value of attribute tags.
16 17 18 |
# File 'lib/processout/gateway.rb', line 16 def end |
#url ⇒ Object
Returns the value of attribute url.
14 15 16 |
# File 'lib/processout/gateway.rb', line 14 def url @url 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
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/processout/gateway.rb', line 79 def fill_with_data(data) if data.nil? return self end if data.include? "id" self.id = data["id"] end if data.include? "name" self.name = data["name"] end if data.include? "display_name" self.display_name = data["display_name"] end if data.include? "logo_url" self.logo_url = data["logo_url"] end if data.include? "url" self.url = data["url"] end if data.include? "flows" self.flows = data["flows"] end if data.include? "tags" self. = data["tags"] end if data.include? "description" self.description = data["description"] end self end |
#new(data = {}) ⇒ Object
Create a new Gateway using the current client
72 73 74 |
# File 'lib/processout/gateway.rb', line 72 def new(data = {}) Gateway.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data-
Hashof data
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/processout/gateway.rb', line 114 def prefill(data) if data.nil? return self end self.id = data.fetch(:id, self.id) self.name = data.fetch(:name, self.name) self.display_name = data.fetch(:display_name, self.display_name) self.logo_url = data.fetch(:logo_url, self.logo_url) self.url = data.fetch(:url, self.url) self.flows = data.fetch(:flows, self.flows) self. = data.fetch(:tags, self.) self.description = data.fetch(:description, self.description) self end |