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.



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

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.



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

def region_id
  @region_id
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24437
24438
24439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24437

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

#to_hashObject



24441
24442
24443
24444
24445
24446
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24441

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

#to_jsonObject



24433
24434
24435
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24433

def to_json
  JSON.dump(to_hash)
end