Class: Rbindkeys::FixResolver

Inherits:
BindResolver show all
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

Methods inherited from BindResolver

#just_resolve

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

Raises:

  • (RuntimeError)


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