Class: Io::Flow::V0::Models::RegionSettingForm

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 = {}) ⇒ RegionSettingForm

Returns a new instance of RegionSettingForm.



25338
25339
25340
25341
25342
25343
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25338

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:region_id, :status], 'RegionSettingForm')
  @region_id = HttpClient::Preconditions.assert_class('region_id', opts.delete(:region_id), String)
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::AvailabilityStatus) ? x : ::Io::Flow::V0::Models::AvailabilityStatus.apply(x))
end

Instance Attribute Details

#region_idObject (readonly)

Returns the value of attribute region_id.



25336
25337
25338
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25336

def region_id
  @region_id
end

#statusObject (readonly)

Returns the value of attribute status.



25336
25337
25338
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25336

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25349
25350
25351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25349

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

#to_hashObject



25353
25354
25355
25356
25357
25358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25353

def to_hash
  {
    :region_id => region_id,
    :status => status.value
  }
end

#to_jsonObject



25345
25346
25347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25345

def to_json
  JSON.dump(to_hash)
end