Class: Core::Inspect::Inspection
- Inherits:
-
Object
- Object
- Core::Inspect::Inspection
- Defined in:
- lib/core/inspect/inspection.rb
Overview
- public
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
[public].
Instance Method Summary collapse
-
#initialize(name:, resolver: name.to_s) ⇒ Inspection
constructor
A new instance of Inspection.
-
#resolve(context) ⇒ Object
[public].
Constructor Details
#initialize(name:, resolver: name.to_s) ⇒ Inspection
Returns a new instance of Inspection.
8 9 10 11 |
# File 'lib/core/inspect/inspection.rb', line 8 def initialize(name:, resolver: name.to_s) @name = name.to_s @resolver = resolver end |
Instance Attribute Details
#name ⇒ Object (readonly)
- public
15 16 17 |
# File 'lib/core/inspect/inspection.rb', line 15 def name @name end |
Instance Method Details
#resolve(context) ⇒ Object
- public
19 20 21 22 23 24 25 |
# File 'lib/core/inspect/inspection.rb', line 19 def resolve(context) if @resolver.start_with?("@") context.instance_variable_get(@resolver) else context.__send__(@resolver) end end |