Class: Io::Flow::V0::Models::SimplePermissionCheck
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SimplePermissionCheck
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A simple model, used to convey permitted behaviors along with approval of a request for a specific permitted route.
Instance Attribute Summary collapse
-
#behaviors ⇒ Object
readonly
Returns the value of attribute behaviors.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SimplePermissionCheck
constructor
A new instance of SimplePermissionCheck.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SimplePermissionCheck
Returns a new instance of SimplePermissionCheck.
51572 51573 51574 51575 51576 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51572 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:behaviors], 'SimplePermissionCheck') @behaviors = HttpClient::Preconditions.assert_class('behaviors', opts.delete(:behaviors), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::FlowBehavior) ? x : ::Io::Flow::V0::Models::FlowBehavior.apply(x)) } end |
Instance Attribute Details
#behaviors ⇒ Object (readonly)
Returns the value of attribute behaviors.
51570 51571 51572 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51570 def behaviors @behaviors end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
51582 51583 51584 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51582 def copy(incoming={}) SimplePermissionCheck.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
51586 51587 51588 51589 51590 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51586 def to_hash { :behaviors => behaviors.map { |o| o.value } } end |
#to_json ⇒ Object
51578 51579 51580 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51578 def to_json JSON.dump(to_hash) end |