Class: Burgundy::Guard
- Inherits:
-
Object
- Object
- Burgundy::Guard
- Defined in:
- lib/burgundy/guard.rb
Instance Method Summary collapse
-
#initialize(item) ⇒ Guard
constructor
A new instance of Guard.
-
#method_missing(name) ⇒ Object
rubocop:disable Style/MethodMissingSuper.
- #respond_to_missing? ⇒ Boolean
Constructor Details
#initialize(item) ⇒ Guard
Returns a new instance of Guard.
5 6 7 |
# File 'lib/burgundy/guard.rb', line 5 def initialize(item) @item = item end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
rubocop:disable Style/MethodMissingSuper
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/burgundy/guard.rb', line 9 def method_missing(name, *) # rubocop:disable Style/MethodMissingSuper class_name = @item.class.name || @item.class.inspect = %W[ #{class_name} was initialized without a delegating object and didn't implement #{class_name}##{name} ].join(" ") raise ArgumentError, "#{error_message}\n#{caller[1]}" end |
Instance Method Details
#respond_to_missing? ⇒ Boolean
20 21 22 |
# File 'lib/burgundy/guard.rb', line 20 def respond_to_missing?(*) true end |