Class: CqlRuby::Crumb

Inherits:
Object
  • Object
show all
Defined in:
lib/cql_ruby/executor.rb

Instance Method Summary collapse

Constructor Details

#initialize(node, ancestors, source_reader) ⇒ Crumb

Returns a new instance of Crumb.



128
129
130
131
132
# File 'lib/cql_ruby/executor.rb', line 128

def initialize(node, ancestors, source_reader)
  @node = node
  @ancestors = ancestors
  @source_reader = source_reader
end

Instance Method Details

#expression_sizeObject



154
155
156
# File 'lib/cql_ruby/executor.rb', line 154

def expression_size
  anchor.location.expression.size
end

#file_nameObject



150
151
152
# File 'lib/cql_ruby/executor.rb', line 150

def file_name
  source_reader.file
end

#line_col_noObject



138
139
140
# File 'lib/cql_ruby/executor.rb', line 138

def line_col_no
  anchor.location.expression.column
end

#line_noObject



134
135
136
# File 'lib/cql_ruby/executor.rb', line 134

def line_no
  anchor.location.expression.line
end

#sourceObject



142
143
144
# File 'lib/cql_ruby/executor.rb', line 142

def source
  source_reader.source_line(line_no)
end

#surrounding_line(offset) ⇒ Object



146
147
148
# File 'lib/cql_ruby/executor.rb', line 146

def surrounding_line(offset)
  source_reader.source_line(line_no + offset)
end

#typeObject



158
159
160
# File 'lib/cql_ruby/executor.rb', line 158

def type
  anchor.type
end