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
Source
# File lib/vagrant_cloud/data.rb, line 34 def initialize(**opts) @data = opts end
Create a new instance
@return [Data]
Public Instance Methods
Source
# File lib/vagrant_cloud/data.rb, line 42 def [](k) @data.key?(k.to_sym) ? @data[k.to_sym] : Nil end
Fetch value from data
@param [String, Symbol] k Name of value @return [Object]
Source
# File lib/vagrant_cloud/data.rb, line 47 def inspect "<#{self.class.name}:#{sprintf("%#x", object_id)}>" end
@return [String]