Class: JCR::Root

Inherits:
Object
  • Object
show all
Defined in:
lib/jcr/find_roots.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule, name = nil, nameless = true, default = false) ⇒ Root

Returns a new instance of Root.



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jcr/find_roots.rb', line 23

def initialize rule, name = nil, nameless = true, default = false
  @rule = rule
  @name = name
  @nameless = nameless
  if name
    @nameless = false
  end
  @default = default
  @slice = JCR::find_first_slice( rule )
  @pos = @slice.line_and_column
  @offset = @slice.offset
end

Instance Attribute Details

#defaultObject

Returns the value of attribute default.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def default
  @default
end

#failuresObject

Returns the value of attribute failures.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def failures
  @failures
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def name
  @name
end

#namelessObject

Returns the value of attribute nameless.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def nameless
  @nameless
end

#offsetObject

Returns the value of attribute offset.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def offset
  @offset
end

#posObject

Returns the value of attribute pos.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def pos
  @pos
end

#ruleObject

Returns the value of attribute rule.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def rule
  @rule
end

#sliceObject

Returns the value of attribute slice.



21
22
23
# File 'lib/jcr/find_roots.rb', line 21

def slice
  @slice
end