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.
30946 30947 30948 30949 30950 30951 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30946 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.
30944 30945 30946 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30944 def number_items @number_items end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
30944 30945 30946 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30944 def state @state end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30957 30958 30959 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30957 def copy(incoming={}) ExclusionRuleStatistic.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30961 30962 30963 30964 30965 30966 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30961 def to_hash { :state => state.value, :number_items => number_items } end |
#to_json ⇒ Object
30953 30954 30955 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30953 def to_json JSON.dump(to_hash) end |