Class: Rbindkeys::FixResolver
- Inherits:
-
BindResolver
- Object
- BindResolver
- Rbindkeys::FixResolver
- Defined in:
- lib/rbindkeys/fix_resolver.rb,
lib/rbindkeys.rb
Overview
last resolvers which return @val as the resolve result
Constant Summary collapse
- @@pool =
{}
Constants inherited from BindResolver
BindResolver::DEFAULT_VALUE, BindResolver::LOG
Instance Attribute Summary
Attributes inherited from BindResolver
#tree, #two_stroke, #upper_resolver
Class Method Summary collapse
Instance Method Summary collapse
- #bind(input, output) ⇒ Object
-
#initialize(val) ⇒ FixResolver
constructor
A new instance of FixResolver.
- #resolve(code, code_set) ⇒ Object
Methods inherited from BindResolver
Constructor Details
#initialize(val) ⇒ FixResolver
Returns a new instance of FixResolver.
14 15 16 |
# File 'lib/rbindkeys/fix_resolver.rb', line 14 def initialize val @val = val end |
Class Method Details
.instance(val) ⇒ Object
10 11 12 |
# File 'lib/rbindkeys/fix_resolver.rb', line 10 def self.instance val @@pool[val] or (@@pool[val] = new val) end |
Instance Method Details
#bind(input, output) ⇒ Object
18 19 20 |
# File 'lib/rbindkeys/fix_resolver.rb', line 18 def bind input, output raise RuntimeError, 'cannot bind any input/output' end |
#resolve(code, code_set) ⇒ Object
22 23 24 |
# File 'lib/rbindkeys/fix_resolver.rb', line 22 def resolve code, code_set @val end |