Class: Niente::ShoesSpecProxy

Inherits:
Object
  • Object
show all
Defined in:
lacci/lib/scarpe/niente/shoes_spec.rb

Constant Summary collapse

JS_EVENTS =
[:click, :hover, :leave]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ ShoesSpecProxy

Returns a new instance of ShoesSpecProxy.



66
67
68
69
70
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 66

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



72
73
74
75
76
77
78
79
80
81
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 72

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

#displayObject (readonly)

Returns the value of attribute display.



64
65
66
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 64

def display
  @display
end

#linkable_idObject (readonly)

Returns the value of attribute linkable_id.



63
64
65
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 63

def linkable_id
  @linkable_id
end

#objObject (readonly)

Returns the value of attribute obj.



62
63
64
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 62

def obj
  @obj
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lacci/lib/scarpe/niente/shoes_spec.rb', line 90

def respond_to_missing?(method_name, include_private = false)
  @obj.respond_to_missing?(method_name, include_private)
end