Class: YPS::Value

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/yps/value.rb

Overview

Value is a wrapper class for a parsed object and serves two main functions:

  1. As a placeholder and accessor for the position information of the wrapped object (via the #position method).

  2. Forwarding received method calls to the wrapped object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, position) ⇒ Value

:nodoc:



55
56
57
58
# File 'lib/yps/value.rb', line 55

def initialize(value, position) # :nodoc:
  super(value)
  @position = position
end

Instance Attribute Details

#positionObject (readonly)

Accessor for the position information of the wrapped object



68
69
70
# File 'lib/yps/value.rb', line 68

def position
  @position
end

Instance Method Details

#valueObject

Accessor for the wrapped object



62
63
64
# File 'lib/yps/value.rb', line 62

def value
  __getobj__
end