Class: Ambition::Processors::Slice

Inherits:
Base show all
Defined in:
lib/ambition/processors/slice.rb

Instance Method Summary collapse

Methods inherited from Base

#key, #process, #process_array, #process_dasgn_curr, #process_dvar, #process_false, #process_gvar, #process_ivar, #process_lit, #process_lvar, #process_nil, #process_proc, #process_str, #process_true, #process_vcall, #rubify, #translator, translator, #value

Constructor Details

#initialize(context, start, length = nil) ⇒ Slice

Returns a new instance of Slice.



4
5
6
7
8
# File 'lib/ambition/processors/slice.rb', line 4

def initialize(context, start, length=nil)
  @context = context
  @start   = start
  @length  = length
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/ambition/processors/slice.rb', line 10

def to_s
  translator.slice(@start, @length)
end