Class: Io::Flow::V0::Models::Deminimus

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

Direct Known Subclasses

DeminimusSimple, DeminimusUndefinedType

Defined Under Namespace

Modules: Types

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ Deminimus

Returns a new instance of Deminimus.



3843
3844
3845
3846
3847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3843

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name], 'Deminimus')
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
end

Class Method Details

.from_json(hash) ⇒ Object



3853
3854
3855
3856
3857
3858
3859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3853

def Deminimus.from_json(hash)
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
  case HttpClient::Helper.symbolize_keys(hash)[:discriminator]
    when Types::DEMINIMUS_SIMPLE; DeminimusSimple.new(hash)
    else DeminimusUndefinedType.new(:name => union_type_name)
  end
end

Instance Method Details

#to_hashObject



3849
3850
3851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3849

def to_hash
  subtype_to_hash.merge(:discriminator => @name)
end