Class: SDM::NodeGetResponse

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

Overview

NodeGetResponse returns a requested Node.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta: nil, node: nil, rate_limit: nil) ⇒ NodeGetResponse

Returns a new instance of NodeGetResponse.



7282
7283
7284
7285
7286
7287
7288
7289
7290
# File 'lib/models/porcelain.rb', line 7282

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

Instance Attribute Details

#metaObject

Reserved for future use.



7276
7277
7278
# File 'lib/models/porcelain.rb', line 7276

def meta
  @meta
end

#nodeObject

The requested Node.



7278
7279
7280
# File 'lib/models/porcelain.rb', line 7278

def node
  @node
end

#rate_limitObject

Rate limit information.



7280
7281
7282
# File 'lib/models/porcelain.rb', line 7280

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



7292
7293
7294
7295
7296
7297
7298
# File 'lib/models/porcelain.rb', line 7292

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