Class: Io::Flow::V0::Models::PayoutAttachment

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PayoutAttachment

Returns a new instance of PayoutAttachment.



59190
59191
59192
59193
59194
59195
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59190

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:type, :url], 'PayoutAttachment')
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::PayoutAttachmentType) ? x : ::Io::Flow::V0::Models::PayoutAttachmentType.apply(x))
  @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



59188
59189
59190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59188

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



59188
59189
59190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59188

def url
  @url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



59201
59202
59203
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59201

def copy(incoming={})
  PayoutAttachment.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



59205
59206
59207
59208
59209
59210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59205

def to_hash
  {
    :type => type.value,
    :url => url
  }
end

#to_jsonObject



59197
59198
59199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59197

def to_json
  JSON.dump(to_hash)
end