module Amorail::MethodMissing

Return hash key as method call

Public Instance Methods

method_missing(method_sym, *arguments, &block) click to toggle source
Calls superclass method
# File lib/amorail/property.rb, line 6
def method_missing(method_sym, *arguments, &block)
  if data.key?(method_sym.to_s.downcase)
    data.fetch(method_sym.to_s.downcase)
  else
    super
  end
end
respond_to_missing?(method_sym, *args) click to toggle source
# File lib/amorail/property.rb, line 14
def respond_to_missing?(method_sym, *args)
  args.size.zero? && data.key?(method_sym.to_s.downcase)
end