Class: Io::Flow::V0::Models::Options

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

Overview

Flags to indicate whether a feature is enabled/disabled on a particular model (e.g. show/do not show attribute as a column in harmonization table view of items)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ Options

Returns a new instance of Options.



47313
47314
47315
47316
47317
47318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47313

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @required = HttpClient::Preconditions.assert_boolean('required', (x = opts.delete(:required); x.nil? ? false : x))
  @show_in_catalog = HttpClient::Preconditions.assert_boolean('show_in_catalog', (x = opts.delete(:show_in_catalog); x.nil? ? false : x))
  @show_in_harmonization = HttpClient::Preconditions.assert_boolean('show_in_harmonization', (x = opts.delete(:show_in_harmonization); x.nil? ? false : x))
end

Instance Attribute Details

#requiredObject (readonly)

Returns the value of attribute required.



47311
47312
47313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47311

def required
  @required
end

#show_in_catalogObject (readonly)

Returns the value of attribute show_in_catalog.



47311
47312
47313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47311

def show_in_catalog
  @show_in_catalog
end

#show_in_harmonizationObject (readonly)

Returns the value of attribute show_in_harmonization.



47311
47312
47313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47311

def show_in_harmonization
  @show_in_harmonization
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47324
47325
47326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47324

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

#to_hashObject



47328
47329
47330
47331
47332
47333
47334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47328

def to_hash
  {
    :required => required,
    :show_in_catalog => show_in_catalog,
    :show_in_harmonization => show_in_harmonization
  }
end

#to_jsonObject



47320
47321
47322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47320

def to_json
  JSON.dump(to_hash)
end