Class: ProcessOut::InvoiceDevice
- Inherits:
-
Object
- Object
- ProcessOut::InvoiceDevice
- Defined in:
- lib/processout/invoice_device.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#id ⇒ Object
Returns the value of attribute id.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#threeds_sdk ⇒ Object
Returns the value of attribute threeds_sdk.
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. -
#initialize(client, data = {}) ⇒ InvoiceDevice
constructor
Initializes the InvoiceDevice object Params:
client::ProcessOutclient instancedata:: data that can be used to fill the object. -
#new(data = {}) ⇒ Object
Create a new InvoiceDevice using the current client.
-
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data::Hashof data. -
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want.
Constructor Details
#initialize(client, data = {}) ⇒ InvoiceDevice
Initializes the InvoiceDevice object Params:
clientProcessOutclient instancedatadata that can be used to fill the object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/processout/invoice_device.rb', line 43 def initialize(client, data = {}) @client = client self.channel = data.fetch(:channel, nil) self.threeds_sdk = data.fetch(:threeds_sdk, nil) self.platform = data.fetch(:platform, nil) self.ip_address = data.fetch(:ip_address, nil) self.id = data.fetch(:id, nil) end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
11 12 13 |
# File 'lib/processout/invoice_device.rb', line 11 def channel @channel end |
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/processout/invoice_device.rb', line 15 def id @id end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
14 15 16 |
# File 'lib/processout/invoice_device.rb', line 14 def ip_address @ip_address end |
#platform ⇒ Object
Returns the value of attribute platform.
13 14 15 |
# File 'lib/processout/invoice_device.rb', line 13 def platform @platform end |
#threeds_sdk ⇒ Object
Returns the value of attribute threeds_sdk.
12 13 14 |
# File 'lib/processout/invoice_device.rb', line 12 def threeds_sdk @threeds_sdk end |
Instance Method Details
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
dataHashof data coming from the API
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/processout/invoice_device.rb', line 73 def fill_with_data(data) if data.nil? return self end if data.include? "channel" self.channel = data["channel"] end if data.include? "threeds_sdk" self.threeds_sdk = data["threeds_sdk"] end if data.include? "platform" self.platform = data["platform"] end if data.include? "ip_address" self.ip_address = data["ip_address"] end if data.include? "id" self.id = data["id"] end self end |
#new(data = {}) ⇒ Object
Create a new InvoiceDevice using the current client
55 56 57 |
# File 'lib/processout/invoice_device.rb', line 55 def new(data = {}) InvoiceDevice.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
dataHashof data
99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/processout/invoice_device.rb', line 99 def prefill(data) if data.nil? return self end self.channel = data.fetch(:channel, self.channel) self.threeds_sdk = data.fetch(:threeds_sdk, self.threeds_sdk) self.platform = data.fetch(:platform, self.platform) self.ip_address = data.fetch(:ip_address, self.ip_address) self.id = data.fetch(:id, self.id) self end |
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want
60 61 62 63 64 65 66 67 68 |
# File 'lib/processout/invoice_device.rb', line 60 def to_json() { "channel": self.channel, "threeds_sdk": self.threeds_sdk, "platform": self.platform, "ip_address": self.ip_address, "id": self.id, }.to_json end |