Class: Io::Flow::V0::Models::TierDefaultForm

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

Overview

Form to set the defualt tier for a given experience

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TierDefaultForm

Returns a new instance of TierDefaultForm.



21494
21495
21496
21497
21498
21499
21500
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21494

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

Instance Attribute Details

#currency ⇒ Object (readonly)

Returns the value of attribute currency.



21492
21493
21494
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21492

def currency
  @currency
end

#default_tier ⇒ Object (readonly)

Returns the value of attribute default_tier.



21492
21493
21494
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21492

def default_tier
  @default_tier
end

#experience ⇒ Object (readonly)

Returns the value of attribute experience.



21492
21493
21494
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21492

def experience
  @experience
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21506
21507
21508
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21506

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

#to_hash ⇒ Object



21510
21511
21512
21513
21514
21515
21516
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21510

def to_hash
  {
    :default_tier => default_tier,
    :currency => currency,
    :experience => experience
  }
end

#to_json ⇒ Object



21502
21503
21504
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21502

def to_json
  JSON.dump(to_hash)
end