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.



24408
24409
24410
24411
24412
24413
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24408

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.



24406
24407
24408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24406

def region_id
  @region_id
end

#statusObject (readonly)

Returns the value of attribute status.



24406
24407
24408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24406

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24419
24420
24421
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24419

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

#to_hashObject



24423
24424
24425
24426
24427
24428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24423

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

#to_jsonObject



24415
24416
24417
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24415

def to_json
  JSON.dump(to_hash)
end