Class: Stupidedi::Reader::ComponentElementTok

Inherits:
Object
  • Object
show all
Includes:
Inspect
Defined in:
lib/stupidedi/reader/tokens/component_element_tok.rb

Instance Attribute Summary collapse

Constructors collapse

Instance Method Summary collapse

Methods included from Inspect

#inspect

Constructor Details

#initialize(value, position, remainder) ⇒ ComponentElementTok

Returns a new instance of ComponentElementTok



18
19
20
21
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 18

def initialize(value, position, remainder)
  @value, @position, @remainder =
    value, position, remainder
end

Instance Attribute Details

#positionPosition (readonly)

Returns:



13
14
15
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 13

def position
  @position
end

#remainderPosition (readonly)

Returns:



16
17
18
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 16

def remainder
  @remainder
end

#valueString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 10

def value
  @value
end

Class Method Details

.build(value, position, remainder) ⇒ ComponentElementTok

Returns:



49
50
51
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 49

def build(value, position, remainder)
  new(value, position, remainder)
end

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 27

def blank?
  @value.blank?
end

#composite?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 39

def composite?
  false
end

#present?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 31

def present?
  not blank?
end

#pretty_print(q)



23
24
25
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 23

def pretty_print(q)
  q.pp(:component.cons(@value.cons))
end

#simple?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 35

def simple?
  true
end