class Decode::Syntax::Match

Attributes

range[R]

Public Class Methods

new(range) click to toggle source
# File lib/decode/syntax/match.rb, line 24
def initialize(range)
        @range = range
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/decode/syntax/match.rb, line 34
def <=> other
        @range.min <=> other.range.min
end
apply(source) click to toggle source
# File lib/decode/syntax/match.rb, line 30
def apply(source)
        return source[range]
end
offset() click to toggle source
# File lib/decode/syntax/match.rb, line 38
def offset
        @range.min
end
size() click to toggle source
# File lib/decode/syntax/match.rb, line 42
def size
        @range.size
end