Class: SDM::PolicyCreateResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

PolicyCreateResponse reports how the Policy was created in the system.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(policy: nil, rate_limit: nil) ⇒ PolicyCreateResponse

Returns a new instance of PolicyCreateResponse.



11924
11925
11926
11927
11928
11929
11930
# File 'lib/models/porcelain.rb', line 11924

def initialize(
  policy: nil,
  rate_limit: nil
)
  @policy = policy == nil ? nil : policy
  @rate_limit = rate_limit == nil ? nil : rate_limit
end

Instance Attribute Details

#policyObject

The created Policy.



11920
11921
11922
# File 'lib/models/porcelain.rb', line 11920

def policy
  @policy
end

#rate_limitObject

Rate limit information.



11922
11923
11924
# File 'lib/models/porcelain.rb', line 11922

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



11932
11933
11934
11935
11936
11937
11938
# File 'lib/models/porcelain.rb', line 11932

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end