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.



28092
28093
28094
28095
28096
28097
28098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092

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.



28090
28091
28092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28090

def currency
  @currency
end

#default_tierObject (readonly)

Returns the value of attribute default_tier.



28090
28091
28092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28090

def default_tier
  @default_tier
end

#experienceObject (readonly)

Returns the value of attribute experience.



28090
28091
28092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28090

def experience
  @experience
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28104
28105
28106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28104

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

#to_hashObject



28108
28109
28110
28111
28112
28113
28114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28108

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

#to_jsonObject



28100
28101
28102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28100

def to_json
  JSON.dump(to_hash)
end