Class: Hashie::Mash

Inherits:
Object
  • Object
show all
Defined in:
lib/hashie-forbidden_attributes/hashie/mash.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object



13
14
15
16
# File 'lib/hashie-forbidden_attributes/hashie/mash.rb', line 13

def method_missing(method_name, *args)
  fail ArgumentError if method_name == :permitted?
  _method_missing(method_name, *args)
end

Instance Method Details

#_method_missingObject



6
# File 'lib/hashie-forbidden_attributes/hashie/mash.rb', line 6

alias_method :_method_missing, :method_missing

#_respond_to_missing?Object



5
# File 'lib/hashie-forbidden_attributes/hashie/mash.rb', line 5

alias_method :_respond_to_missing?, :respond_to_missing?

#respond_to_missing?(method_name, *args) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/hashie-forbidden_attributes/hashie/mash.rb', line 8

def respond_to_missing?(method_name, *args)
  return false if method_name == :permitted?
  _respond_to_missing?(method_name, args)
end