Class: Factbase::Tee
- Inherits:
-
Object
- Object
- Factbase::Tee
- Defined in:
- lib/factbase/tee.rb
Overview
Tee of two facts.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
-
#initialize(fact, upper) ⇒ Tee
constructor
Ctor.
- #method_missing(*args) ⇒ Object
-
#respond_to?(_method, _include_private = false) ⇒ Boolean
rubocop:disable Style/OptionalBooleanParameter.
- #respond_to_missing?(_method, _include_private = false) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(fact, upper) ⇒ Tee
Ctor.
34 35 36 37 |
# File 'lib/factbase/tee.rb', line 34 def initialize(fact, upper) @fact = fact @upper = upper end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
43 44 45 46 |
# File 'lib/factbase/tee.rb', line 43 def method_missing(*args) return @upper[args[1].to_s[1..]] if args[0].to_s == '[]' && args[1].to_s.start_with?('$') @fact.method_missing(*args) end |
Instance Method Details
#respond_to?(_method, _include_private = false) ⇒ Boolean
rubocop:disable Style/OptionalBooleanParameter
49 50 51 52 |
# File 'lib/factbase/tee.rb', line 49 def respond_to?(_method, _include_private = false) # rubocop:enable Style/OptionalBooleanParameter true end |
#respond_to_missing?(_method, _include_private = false) ⇒ Boolean
54 55 56 |
# File 'lib/factbase/tee.rb', line 54 def respond_to_missing?(_method, _include_private = false) true end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/factbase/tee.rb', line 39 def to_s @fact.to_s end |