Class: Niente::ShoesSpecProxy
- Inherits:
-
Object
- Object
- Niente::ShoesSpecProxy
- Defined in:
- lacci/lib/scarpe/niente/shoes_spec.rb
Constant Summary collapse
- JS_EVENTS =
[:click, :hover, :leave]
Instance Attribute Summary collapse
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#linkable_id ⇒ Object
readonly
Returns the value of attribute linkable_id.
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
Instance Method Summary collapse
-
#initialize(obj) ⇒ ShoesSpecProxy
constructor
A new instance of ShoesSpecProxy.
- #method_missing(method) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(obj) ⇒ ShoesSpecProxy
Returns a new instance of ShoesSpecProxy.
65 66 67 68 69 |
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 65 def initialize(obj) @obj = obj @linkable_id = obj.linkable_id @display = ::Shoes::DisplayService.display_service.query_display_drawable_for(obj.linkable_id) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object
71 72 73 74 75 76 77 78 79 80 |
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 71 def method_missing(method, ...) if @obj.respond_to?(method) self.singleton_class.define_method(method) do |*args, **kwargs, &block| @obj.send(method, *args, **kwargs, &block) end send(method, ...) else super # raise an exception end end |
Instance Attribute Details
#display ⇒ Object (readonly)
Returns the value of attribute display.
63 64 65 |
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 63 def display @display end |
#linkable_id ⇒ Object (readonly)
Returns the value of attribute linkable_id.
62 63 64 |
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 62 def linkable_id @linkable_id end |
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
61 62 63 |
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 61 def obj @obj end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
89 90 91 |
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 89 def respond_to_missing?(method_name, include_private = false) @obj.respond_to_missing?(method_name, include_private) end |