class JMESPath::Nodes::SimpleSlice

Public Class Methods

new(start, stop) click to toggle source
Calls superclass method JMESPath::Nodes::Slice::new
# File lib/jmespath/nodes/slice.rb, line 78
def initialize(start, stop)
  super(start, stop, 1)
end

Public Instance Methods

visit(value) click to toggle source
# File lib/jmespath/nodes/slice.rb, line 82
def visit(value)
  if String === value || Array === value
    value[@start, @stop - @start]
  else
    nil
  end
end