Class: SDM::ResourceGetResponse
- Inherits:
-
Object
- Object
- SDM::ResourceGetResponse
- Defined in:
- lib/models/porcelain.rb
Overview
ResourceGetResponse returns a requested Resource.
Instance Attribute Summary collapse
-
#meta ⇒ Object
Reserved for future use.
-
#rate_limit ⇒ Object
Rate limit information.
-
#resource ⇒ Object
The requested Resource.
Instance Method Summary collapse
-
#initialize(meta: nil, rate_limit: nil, resource: nil) ⇒ ResourceGetResponse
constructor
A new instance of ResourceGetResponse.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(meta: nil, rate_limit: nil, resource: nil) ⇒ ResourceGetResponse
Returns a new instance of ResourceGetResponse.
9322 9323 9324 9325 9326 9327 9328 9329 9330 |
# File 'lib/models/porcelain.rb', line 9322 def initialize( meta: nil, rate_limit: nil, resource: nil ) = == nil ? nil : @rate_limit = rate_limit == nil ? nil : rate_limit @resource = resource == nil ? nil : resource end |
Instance Attribute Details
#meta ⇒ Object
Reserved for future use.
9316 9317 9318 |
# File 'lib/models/porcelain.rb', line 9316 def end |
#rate_limit ⇒ Object
Rate limit information.
9318 9319 9320 |
# File 'lib/models/porcelain.rb', line 9318 def rate_limit @rate_limit end |
#resource ⇒ Object
The requested Resource.
9320 9321 9322 |
# File 'lib/models/porcelain.rb', line 9320 def resource @resource end |
Instance Method Details
#to_json(options = {}) ⇒ Object
9332 9333 9334 9335 9336 9337 9338 |
# File 'lib/models/porcelain.rb', line 9332 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |