module MethodifyHash::Module

Public Class Methods

extended(klass) click to toggle source
# File lib/methodify_hash/module.rb, line 10
def self.extended(klass)
  if (klass == Hash) == false && (klass.class == Hash) == false
    raise NoHashError, 'MethodifyHash was not used on a Hash'
  end
end
included(klass) click to toggle source
# File lib/methodify_hash/module.rb, line 16
def self.included(klass)
  if (klass == Hash) == false && (klass.class == Hash) == false
    raise NoHashError, 'MethodifyHash was not used on a Hash'
  end
end

Public Instance Methods

method_missing(method_id) click to toggle source
# File lib/methodify_hash/module.rb, line 5
def method_missing(method_id)
  attr_name = method_id.id2name
  self[attr_name] || self[attr_name.to_sym]
end