Class: Factbase::Looged::Fact
- Inherits:
-
Object
- Object
- Factbase::Looged::Fact
- Defined in:
- lib/factbase/looged.rb
Overview
Fact decorator.
Instance Method Summary collapse
-
#initialize(fact, loog) ⇒ Fact
constructor
A new instance of Fact.
- #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, loog) ⇒ Fact
Returns a new instance of Fact.
75 76 77 78 |
# File 'lib/factbase/looged.rb', line 75 def initialize(fact, loog) @fact = fact @loog = loog end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/factbase/looged.rb', line 84 def method_missing(*args) r = @fact.method_missing(*args) k = args[0].to_s v = args[1] @loog.debug("Set '#{k[0..-2]}' to #{v.to_s.inspect} (#{v.class})") if k.end_with?('=') r end |
Instance Method Details
#respond_to?(method, include_private = false) ⇒ Boolean
rubocop:disable Style/OptionalBooleanParameter
93 94 95 96 |
# File 'lib/factbase/looged.rb', line 93 def respond_to?(method, include_private = false) # rubocop:enable Style/OptionalBooleanParameter @fact.respond_to?(method, include_private) end |
#respond_to_missing?(method, include_private = false) ⇒ Boolean
98 99 100 |
# File 'lib/factbase/looged.rb', line 98 def respond_to_missing?(method, include_private = false) @fact.respond_to_missing?(method, include_private) end |
#to_s ⇒ Object
80 81 82 |
# File 'lib/factbase/looged.rb', line 80 def to_s @fact.to_s end |