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.



27830
27831
27832
27833
27834
27835
27836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27830

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

#currencyObject (readonly)

Returns the value of attribute currency.



27828
27829
27830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27828

def currency
  @currency
end

#default_tierObject (readonly)

Returns the value of attribute default_tier.



27828
27829
27830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27828

def default_tier
  @default_tier
end

#experienceObject (readonly)

Returns the value of attribute experience.



27828
27829
27830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27828

def experience
  @experience
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



27842
27843
27844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27842

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

#to_hashObject



27846
27847
27848
27849
27850
27851
27852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27846

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

#to_jsonObject



27838
27839
27840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27838

def to_json
  JSON.dump(to_hash)
end