Class: Io::Flow::V0::Models::TierSettings

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TierSettings

Returns a new instance of TierSettings.



70957
70958
70959
70960
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70957

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @availability = (x = (x = opts.delete(:availability); x.nil? ? "always" : x); x.is_a?(::Io::Flow::V0::Models::TierAvailability) ? x : ::Io::Flow::V0::Models::TierAvailability.apply(x))
end

Instance Attribute Details

#availabilityObject (readonly)

Returns the value of attribute availability.



70955
70956
70957
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70955

def availability
  @availability
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



70966
70967
70968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70966

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

#to_hashObject



70970
70971
70972
70973
70974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70970

def to_hash
  {
    :availability => availability.value
  }
end

#to_jsonObject



70962
70963
70964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70962

def to_json
  JSON.dump(to_hash)
end