Class: Io::Flow::V0::Models::Options
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Options
- 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
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#show_in_catalog ⇒ Object
readonly
Returns the value of attribute show_in_catalog.
-
#show_in_harmonization ⇒ Object
readonly
Returns the value of attribute show_in_harmonization.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Options
constructor
A new instance of Options.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Options
Returns a new instance of Options.
38824 38825 38826 38827 38828 38829 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38824 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
#required ⇒ Object (readonly)
Returns the value of attribute required.
38822 38823 38824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38822 def required @required end |
#show_in_catalog ⇒ Object (readonly)
Returns the value of attribute show_in_catalog.
38822 38823 38824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38822 def show_in_catalog @show_in_catalog end |
#show_in_harmonization ⇒ Object (readonly)
Returns the value of attribute show_in_harmonization.
38822 38823 38824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38822 def show_in_harmonization @show_in_harmonization end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38835 38836 38837 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38835 def copy(incoming={}) Options.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
38839 38840 38841 38842 38843 38844 38845 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38839 def to_hash { :required => required, :show_in_catalog => show_in_catalog, :show_in_harmonization => show_in_harmonization } end |
#to_json ⇒ Object
38831 38832 38833 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38831 def to_json JSON.dump(to_hash) end |