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.



7996
7997
7998
7999
8000
8001
8002
8003
8004
# File 'lib/models/porcelain.rb', line 7996

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.



7990
7991
7992
# File 'lib/models/porcelain.rb', line 7990

def meta
  @meta
end

#nodeObject

The requested Node.



7992
7993
7994
# File 'lib/models/porcelain.rb', line 7992

def node
  @node
end

#rate_limitObject

Rate limit information.



7994
7995
7996
# File 'lib/models/porcelain.rb', line 7994

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8006
8007
8008
8009
8010
8011
8012
# File 'lib/models/porcelain.rb', line 8006

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