Module: WialonApi::Resolver
Overview
A mixin for classes that will resolve other classes' objects via #method_missing
.
Class Method Summary collapse
-
.included(base_class) ⇒ Object
When this module is included, it undefines the
:send
instance method in thebase_class
so it can be resolved viamethod_missing
.
Instance Method Summary collapse
-
#resolver ⇒ Hashie::Mash
A
Hashie::Mash
structure holding the name and sid of current instance.
Class Method Details
.included(base_class) ⇒ Object
When this module is included, it undefines the :send
instance method in the base_class
so it can be resolved via method_missing
.
27 28 29 30 31 |
# File 'lib/wialon_api/resolver.rb', line 27 def included(base_class) base_class.class_eval do undef_method :send end end |
Instance Method Details
#resolver ⇒ Hashie::Mash
A Hashie::Mash
structure holding the name and sid of current instance.
6 7 8 |
# File 'lib/wialon_api/resolver.rb', line 6 def resolver @resolver ||= Hashie::Mash.new(name: @name, sid: sid) end |