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.



8862
8863
8864
8865
8866
8867
8868
8869
8870
# File 'lib/models/porcelain.rb', line 8862

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.



8856
8857
8858
# File 'lib/models/porcelain.rb', line 8856

def meta
  @meta
end

#policyObject

The requested Policy.



8858
8859
8860
# File 'lib/models/porcelain.rb', line 8858

def policy
  @policy
end

#rate_limitObject

Rate limit information.



8860
8861
8862
# File 'lib/models/porcelain.rb', line 8860

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8872
8873
8874
8875
8876
8877
8878
# File 'lib/models/porcelain.rb', line 8872

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