Class: Tcepsni::Vendor::Rails::Paths::Root

Inherits:
Object
  • Object
show all
Defined in:
lib/tcepsni/vendor/rails/paths/root.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(memory_reference, attributes) ⇒ Root

Returns a new instance of Root.



10
11
12
13
# File 'lib/tcepsni/vendor/rails/paths/root.rb', line 10

def initialize(memory_reference, attributes)
  @memory_reference = memory_reference
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



8
9
10
# File 'lib/tcepsni/vendor/rails/paths/root.rb', line 8

def attributes
  @attributes
end

#memory_referenceObject (readonly)

Returns the value of attribute memory_reference.



8
9
10
# File 'lib/tcepsni/vendor/rails/paths/root.rb', line 8

def memory_reference
  @memory_reference
end

Class Method Details

.dependenciesObject



37
38
39
# File 'lib/tcepsni/vendor/rails/paths/root.rb', line 37

def self.dependencies
  [::Tcepsni::Vendor::Pathname]
end

.object?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/tcepsni/vendor/rails/paths/root.rb', line 33

def self.object?
  true
end

.parse(parser) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/tcepsni/vendor/rails/paths/root.rb', line 15

def self.parse(parser)
  parser.skip('Rails::Paths::Root') or return
  pos = parser.pos
  if (memory_reference = parser.parse_memory_reference)
    if parser.skip(' ...>')
      Tcepsni::Vendor::Rails::Paths::Root.new(memory_reference, {})
    elsif (attrs = parser.parse_attributes) && parser.skip('>')
      Tcepsni::Vendor::Rails::Paths::Root.new(memory_reference, attrs)
    else
      parser.pos = pos
      return
    end
  else
    parser.pos = pos
    nil
  end
end