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.



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

#displayObject (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_idObject (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

#objObject (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

Returns:

  • (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