Class: Io::Flow::V0::Models::ExclusionRuleStatistic
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExclusionRuleStatistic
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#number_items ⇒ Object
readonly
Returns the value of attribute number_items.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExclusionRuleStatistic
constructor
A new instance of ExclusionRuleStatistic.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExclusionRuleStatistic
Returns a new instance of ExclusionRuleStatistic.
30847 30848 30849 30850 30851 30852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30847 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:state, :number_items], 'ExclusionRuleStatistic') @state = (x = opts.delete(:state); x.is_a?(::Io::Flow::V0::Models::ExclusionRuleState) ? x : ::Io::Flow::V0::Models::ExclusionRuleState.apply(x)) @number_items = HttpClient::Preconditions.assert_class('number_items', opts.delete(:number_items), Integer) end |
Instance Attribute Details
#number_items ⇒ Object (readonly)
Returns the value of attribute number_items.
30845 30846 30847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30845 def number_items @number_items end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
30845 30846 30847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30845 def state @state end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30858 30859 30860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30858 def copy(incoming={}) ExclusionRuleStatistic.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30862 30863 30864 30865 30866 30867 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30862 def to_hash { :state => state.value, :number_items => number_items } end |
#to_json ⇒ Object
30854 30855 30856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30854 def to_json JSON.dump(to_hash) end |