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.
30995 30996 30997 30998 30999 31000 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30995 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.
30993 30994 30995 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30993 def number_items @number_items end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
30993 30994 30995 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30993 def state @state end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31006 31007 31008 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31006 def copy(incoming={}) ExclusionRuleStatistic.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31010 31011 31012 31013 31014 31015 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31010 def to_hash { :state => state.value, :number_items => number_items } end |
#to_json ⇒ Object
31002 31003 31004 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31002 def to_json JSON.dump(to_hash) end |