Class: Io::Flow::V0::Models::PaymentMethodImages

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 = {}) ⇒ PaymentMethodImages

Returns a new instance of PaymentMethodImages.



32013
32014
32015
32016
32017
32018
32019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32013

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:small, :medium, :large], 'PaymentMethodImages')
  @small = (x = opts.delete(:small); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImage) ? x : ::Io::Flow::V0::Models::PaymentMethodImage.new(x))
  @medium = (x = opts.delete(:medium); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImage) ? x : ::Io::Flow::V0::Models::PaymentMethodImage.new(x))
  @large = (x = opts.delete(:large); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImage) ? x : ::Io::Flow::V0::Models::PaymentMethodImage.new(x))
end

Instance Attribute Details

#largeObject (readonly)

Returns the value of attribute large.



32011
32012
32013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32011

def large
  @large
end

#mediumObject (readonly)

Returns the value of attribute medium.



32011
32012
32013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32011

def medium
  @medium
end

#smallObject (readonly)

Returns the value of attribute small.



32011
32012
32013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32011

def small
  @small
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32025
32026
32027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32025

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

#to_hashObject



32029
32030
32031
32032
32033
32034
32035
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32029

def to_hash
  {
    :small => small.to_hash,
    :medium => medium.to_hash,
    :large => large.to_hash
  }
end

#to_jsonObject



32021
32022
32023
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32021

def to_json
  JSON.dump(to_hash)
end