Class: Io::Flow::V0::Models::RateForm

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

Overview

Represents the parts of an organization rate that can be updated.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ RateForm

Returns a new instance of RateForm.



24718
24719
24720
24721
24722
24723
24724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24718

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:base, :target, :effective_at], 'RateForm')
  @base = HttpClient::Preconditions.assert_class('base', opts.delete(:base), String)
  @target = HttpClient::Preconditions.assert_class('target', opts.delete(:target), String)
  @effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime)
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



24716
24717
24718
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24716

def base
  @base
end

#effective_atObject (readonly)

Returns the value of attribute effective_at.



24716
24717
24718
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24716

def effective_at
  @effective_at
end

#targetObject (readonly)

Returns the value of attribute target.



24716
24717
24718
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24716

def target
  @target
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24730
24731
24732
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24730

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

#to_hashObject



24734
24735
24736
24737
24738
24739
24740
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24734

def to_hash
  {
    :base => base,
    :target => target,
    :effective_at => effective_at
  }
end

#to_jsonObject



24726
24727
24728
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24726

def to_json
  JSON.dump(to_hash)
end