module Quandl::Sandbox::Server::Attributes

Attributes

new_record[R]

Public Class Methods

new(*args) click to toggle source
Calls superclass method Quandl::Sandbox::Attributes::new
# File lib/quandl/sandbox/server/attributes.rb, line 24
def initialize(*args)
  # is a new record
  self.new_record = true
  # default attributes
  self.attributes = Quandl::Sandbox.configuration.to_h
  # onwards
  super
end

Public Instance Methods

node_name() click to toggle source
# File lib/quandl/sandbox/server/attributes.rb, line 18
def node_name
  @node_name ||= "#{environment}-sandbox-worker-#{uid}"
end
tags() click to toggle source
# File lib/quandl/sandbox/server/attributes.rb, line 37
def tags
  {
    Name:                   node_name,
    cluster_type:           'quandl_sandbox',
    instance_type:          'quandl_ugc_worker',
    instance_environment:   environment,
    vpc:                    ssh_gateway.present? ? 'true' : 'false'
  }
end
uid() click to toggle source
# File lib/quandl/sandbox/server/attributes.rb, line 33
def uid
  @uid ||= SecureRandom.hex(6)
end

Private Instance Methods

new_record=(value) click to toggle source
# File lib/quandl/sandbox/server/attributes.rb, line 49
def new_record=(value)
  @new_record = (value == true)
end