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.



7983
7984
7985
7986
7987
7988
7989
7990
7991
# File 'lib/models/porcelain.rb', line 7983

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.



7977
7978
7979
# File 'lib/models/porcelain.rb', line 7977

def meta
  @meta
end

#nodeObject

The requested Node.



7979
7980
7981
# File 'lib/models/porcelain.rb', line 7979

def node
  @node
end

#rate_limitObject

Rate limit information.



7981
7982
7983
# File 'lib/models/porcelain.rb', line 7981

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



7993
7994
7995
7996
7997
7998
7999
# File 'lib/models/porcelain.rb', line 7993

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