Class: FeedMe::SimpleStruct
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ SimpleStruct
constructor
A new instance of SimpleStruct.
Constructor Details
#initialize(hash = {}) ⇒ SimpleStruct
Returns a new instance of SimpleStruct.
5 6 7 8 9 10 11 |
# File 'lib/feed_me/simple_struct.rb', line 5 def initialize(hash = {}) (class << self; self; end).module_eval do hash.each do |method, result| define_method( method ) { result } end end end |