Class: DonorsChoose::Utils::StaticStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/donors_choose/utils/static_struct.rb

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ StaticStruct

Returns a new instance of StaticStruct.


7
8
9
10
11
12
13
14
15
# File 'lib/donors_choose/utils/static_struct.rb', line 7

def initialize(params={})
  singleton_class.module_eval do
    params.each do |key, value|
      define_method key do
        value
      end
    end
  end
end