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.



24410
24411
24412
24413
24414
24415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24410

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.



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

def region_id
  @region_id
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24421
24422
24423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24421

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

#to_hashObject



24425
24426
24427
24428
24429
24430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24425

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

#to_jsonObject



24417
24418
24419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24417

def to_json
  JSON.dump(to_hash)
end