Class: SDM::PolicyGetResponse

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

Overview

PolicyGetResponse returns a requested Policy.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta: nil, policy: nil, rate_limit: nil) ⇒ PolicyGetResponse

Returns a new instance of PolicyGetResponse.



8849
8850
8851
8852
8853
8854
8855
8856
8857
# File 'lib/models/porcelain.rb', line 8849

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

Instance Attribute Details

#metaObject

Reserved for future use.



8843
8844
8845
# File 'lib/models/porcelain.rb', line 8843

def meta
  @meta
end

#policyObject

The requested Policy.



8845
8846
8847
# File 'lib/models/porcelain.rb', line 8845

def policy
  @policy
end

#rate_limitObject

Rate limit information.



8847
8848
8849
# File 'lib/models/porcelain.rb', line 8847

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8859
8860
8861
8862
8863
8864
8865
# File 'lib/models/porcelain.rb', line 8859

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