Module: HashInitializable

Instance Method Summary collapse

Instance Method Details

#initialize(params = {}) ⇒ Object


3
4
5
6
# File 'lib/git_stats/hash_initializable.rb', line 3

def initialize(params = {})
  raise "pass a Hash to initialize #{self.class}" unless params.is_a? Hash
  params.each { |k, v| instance_variable_set("@#{k}", v) }
end