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.



6152
6153
6154
6155
6156
6157
6158
6159
6160
# File 'lib/models/porcelain.rb', line 6152

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.



6146
6147
6148
# File 'lib/models/porcelain.rb', line 6146

def meta
  @meta
end

#nodeObject

The requested Node.



6148
6149
6150
# File 'lib/models/porcelain.rb', line 6148

def node
  @node
end

#rate_limitObject

Rate limit information.



6150
6151
6152
# File 'lib/models/porcelain.rb', line 6150

def rate_limit
  @rate_limit
end

Instance Method Details

#to_json(options = {}) ⇒ Object



6162
6163
6164
6165
6166
6167
6168
# File 'lib/models/porcelain.rb', line 6162

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