Class: Io::Flow::V0::Models::LogoImageSvg

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

Overview

If the browser knows that an image is a svg, it can dynamically redraw the image to different 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 = {}) ⇒ LogoImageSvg

Returns a new instance of LogoImageSvg.



49439
49440
49441
49442
49443
49444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49439

def initialize(incoming={})
  super(:discriminator => LogoImage::Types::LOGO_IMAGE_SVG)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:url], 'LogoImageSvg')
  @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



49437
49438
49439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49437

def url
  @url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49450
49451
49452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49450

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

#subtype_to_hashObject



49454
49455
49456
49457
49458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49454

def subtype_to_hash
  {
    :url => url
  }
end

#to_jsonObject



49446
49447
49448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49446

def to_json
  JSON.dump(to_hash)
end