Class: Compendium::Params

Inherits:
OpenHash
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/compendium/params.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OpenHash

[], #dup

Constructor Details

#initialize(hash = {}, options = {}) ⇒ Params

Returns a new instance of Params.



13
14
15
16
# File 'lib/compendium/params.rb', line 13

def initialize(hash = {}, options = {})
  @options = options
  super(prepare_hash_from_options(hash))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Compendium::OpenHash

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/compendium/params.rb', line 11

def options
  @options
end

Class Method Details

.model_nameObject



18
19
20
# File 'lib/compendium/params.rb', line 18

def self.model_name
  ActiveModel::Name.new(Compendium::Params, Compendium, 'compendium.params')
end