Class: Rookout::Processor::Paths::Canopy::LookupOperation

Inherits:
Operation
  • Object
show all
Defined in:
lib/rookout/processor/paths/canopy/markers.rb

Instance Method Summary collapse

Methods inherited from Operation

#write

Constructor Details

#initialize(text) ⇒ LookupOperation

Returns a new instance of LookupOperation.



57
58
59
60
61
62
63
64
# File 'lib/rookout/processor/paths/canopy/markers.rb', line 57

def initialize text
  super()
  if (text.start_with?("'") && text.end_with?("'")) || (text.start_with?("\"") && text.end_with?("\""))
    @key = text[1...-1]
  else
    @key = text.to_i
  end
end

Instance Method Details

#read(namepsace, _create) ⇒ Object



66
67
68
# File 'lib/rookout/processor/paths/canopy/markers.rb', line 66

def read namepsace, _create
  namepsace.read_key @key
end