Class: Io::Flow::V0::Models::LogoImageSetStatic

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

Overview

Static images like png or jpeg must be provided in multiple sizes.

Instance Attribute Summary collapse

Attributes inherited from LogoImage

#discriminator

Instance Method Summary collapse

Methods inherited from LogoImage

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ LogoImageSetStatic

Returns a new instance of LogoImageSetStatic.



49376
49377
49378
49379
49380
49381
49382
49383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49376

def initialize(incoming={})
  super(:discriminator => LogoImage::Types::LOGO_IMAGE_SET_STATIC)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:medium], 'LogoImageSetStatic')
  @small = (x = opts.delete(:small); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LogoImageStatic) ? x : ::Io::Flow::V0::Models::LogoImageStatic.new(x)))
  @medium = (x = opts.delete(:medium); x.is_a?(::Io::Flow::V0::Models::LogoImageStatic) ? x : ::Io::Flow::V0::Models::LogoImageStatic.new(x))
  @large = (x = opts.delete(:large); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LogoImageStatic) ? x : ::Io::Flow::V0::Models::LogoImageStatic.new(x)))
end

Instance Attribute Details

#largeObject (readonly)

Returns the value of attribute large.



49374
49375
49376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49374

def large
  @large
end

#mediumObject (readonly)

Returns the value of attribute medium.



49374
49375
49376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49374

def medium
  @medium
end

#smallObject (readonly)

Returns the value of attribute small.



49374
49375
49376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49374

def small
  @small
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49389
49390
49391
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49389

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

#subtype_to_hashObject



49393
49394
49395
49396
49397
49398
49399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49393

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

#to_jsonObject



49385
49386
49387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49385

def to_json
  JSON.dump(to_hash)
end