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

- (ComponentElementTok) initialize(value, position, remainder)

Returns a new instance of ComponentElementTok



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

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

Instance Attribute Details

- (Position) position (readonly)

Returns:



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

def position
  @position
end

- (Position) remainder (readonly)

Returns:



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

def remainder
  @remainder
end

- (String) value (readonly)

Returns:



8
9
10
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 8

def value
  @value
end

Class Method Details

+ (ComponentElementTok) build(value, position, remainder)

Returns:



47
48
49
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 47

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

Instance Method Details

- (Boolean) blank?

Returns:

  • (Boolean)


25
26
27
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 25

def blank?
  @value.blank?
end

- (Boolean) composite?

Returns:

  • (Boolean)


37
38
39
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 37

def composite?
  false
end

- (Boolean) present?

Returns:

  • (Boolean)


29
30
31
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 29

def present?
  not blank?
end

- pretty_print(q)



21
22
23
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 21

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

- (Boolean) simple?

Returns:

  • (Boolean)


33
34
35
# File 'lib/stupidedi/reader/tokens/component_element_tok.rb', line 33

def simple?
  true
end