Class: OptionsHash
- Inherits:
-
Object
- Object
- OptionsHash
- Defined in:
- lib/options-hash.rb
Overview
Options hash which allows defiying the default values and access to items as to properties.
Class Method Summary collapse
-
.get(options = {}) ⇒ OptionsHash
Assigns the options data.
Instance Method Summary collapse
-
#[](defaults = {}) ⇒ Hashie::Mash
Assigns the default values.
-
#initialize(options = {}) ⇒ OptionsHash
constructor
Constructor.
Constructor Details
#initialize(options = {}) ⇒ OptionsHash
Constructor.
37 38 39 |
# File 'lib/options-hash.rb', line 37 def initialize( = {}) @options = end |
Class Method Details
.get(options = {}) ⇒ OptionsHash
Assigns the options data.
28 29 30 |
# File 'lib/options-hash.rb', line 28 def self.get( = {}) self::new() end |
Instance Method Details
#[](defaults = {}) ⇒ Hashie::Mash
Assigns the default values.
48 49 50 |
# File 'lib/options-hash.rb', line 48 def [](defaults = {}) Hashie::Mash::new(defaults.merge(@options)) end |