Class: Io::Flow::V0::Models::PermissionAudit

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Returns all known permissions, along with their authorization technique and all of the roles which contain them.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PermissionAudit

Returns a new instance of PermissionAudit.



38945
38946
38947
38948
38949
38950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38945

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:routes, :behaviors], 'PermissionAudit')
  @routes = HttpClient::Preconditions.assert_class('routes', opts.delete(:routes), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::RouteAudit) ? x : ::Io::Flow::V0::Models::RouteAudit.new(x)) }
  @behaviors = HttpClient::Preconditions.assert_class('behaviors', opts.delete(:behaviors), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::BehaviorAudit) ? x : ::Io::Flow::V0::Models::BehaviorAudit.new(x)) }
end

Instance Attribute Details

#behaviorsObject (readonly)

Returns the value of attribute behaviors.



38943
38944
38945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38943

def behaviors
  @behaviors
end

#routesObject (readonly)

Returns the value of attribute routes.



38943
38944
38945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38943

def routes
  @routes
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38956
38957
38958
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38956

def copy(incoming={})
  PermissionAudit.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



38960
38961
38962
38963
38964
38965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38960

def to_hash
  {
    :routes => routes.map { |o| o.to_hash },
    :behaviors => behaviors.map { |o| o.to_hash }
  }
end

#to_jsonObject



38952
38953
38954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38952

def to_json
  JSON.dump(to_hash)
end