class VagrantCloud::Data

Generic data class which provides simple attribute data storage using a Hash like interface

Constants

Nil

Easy to use constant to access general use instance of our custom nil class

Public Class Methods

new(**opts) click to toggle source

Create a new instance

@return [Data]

# File lib/vagrant_cloud/data.rb, line 34
def initialize(**opts)
  @data = opts
end

Public Instance Methods

[](k) click to toggle source

Fetch value from data

@param [String, Symbol] k Name of value @return [Object]

# File lib/vagrant_cloud/data.rb, line 42
def [](k)
  @data.key?(k.to_sym) ? @data[k.to_sym] : Nil
end
inspect() click to toggle source

@return [String]

# File lib/vagrant_cloud/data.rb, line 47
def inspect
  "<#{self.class.name}:#{sprintf("%#x", object_id)}>"
end

Protected Instance Methods

data() click to toggle source
# File lib/vagrant_cloud/data.rb, line 51
def data; @data; end