Class: SDM::NodeCreateResponse

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

Overview

NodeCreateResponse reports how the Nodes were created in the system.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta: nil, node: nil, rate_limit: nil, token: nil) ⇒ NodeCreateResponse

Returns a new instance of NodeCreateResponse.



12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
# File 'lib/models/porcelain.rb', line 12745

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

Instance Attribute Details

#meta ⇒ Object

Reserved for future use.



12736
12737
12738
# File 'lib/models/porcelain.rb', line 12736

def meta
  @meta
end

#node ⇒ Object

The created Node.



12738
12739
12740
# File 'lib/models/porcelain.rb', line 12738

def node
  @node
end

#rate_limit ⇒ Object

Rate limit information.



12740
12741
12742
# File 'lib/models/porcelain.rb', line 12740

def rate_limit
  @rate_limit
end

#token ⇒ Object

The auth token generated for the Node. The Node will use this token to authenticate with the strongDM API.



12743
12744
12745
# File 'lib/models/porcelain.rb', line 12743

def token
  @token
end

Instance Method Details

#to_json(options = {}) ⇒ Object



12757
12758
12759
12760
12761
12762
12763
# File 'lib/models/porcelain.rb', line 12757

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