class OptionsHash

Options hash which allows defiying the default values and access to items as to properties.

@see github.com/intridea/hashie

Public Class Methods

get(options = {}) click to toggle source

Assigns the options data.

@param [Hash] options options data @return [OptionsHash] itself for service purpose

# File lib/options-hash.rb, line 28
def self.get(options = {})
    self::new(options)
end
new(options = {}) click to toggle source

Constructor. @param [Hash] options options data

# File lib/options-hash.rb, line 37
def initialize(options = {})
    @options = options
end

Public Instance Methods

[](defaults = {}) click to toggle source

Assigns the default values.

@param [Hash] defaults defaults data @return [Hashie::Mash] object-like accessible pseudo-hash

# File lib/options-hash.rb, line 48
def [](defaults = {})
    Hashie::Mash::new(defaults.merge(@options))
end