Class: Argstring::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/argstring/models/token.rb

Direct Known Subclasses

Name, Value

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, raw:, enclosed: false, enclosure: nil) ⇒ Token

enclosure is a hash close: or nil



8
9
10
11
12
13
# File 'lib/argstring/models/token.rb', line 8

def initialize(text:, raw:, enclosed: false, enclosure: nil)
  @text = text
  @raw = raw
  @enclosed = enclosed
  @enclosure = enclosure
end

Instance Attribute Details

#enclosedObject (readonly)

Returns the value of attribute enclosed.



5
6
7
# File 'lib/argstring/models/token.rb', line 5

def enclosed
  @enclosed
end

#enclosureObject (readonly)

Returns the value of attribute enclosure.



5
6
7
# File 'lib/argstring/models/token.rb', line 5

def enclosure
  @enclosure
end

#rawObject (readonly)

Returns the value of attribute raw.



5
6
7
# File 'lib/argstring/models/token.rb', line 5

def raw
  @raw
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/argstring/models/token.rb', line 5

def text
  @text
end

Instance Method Details

#enclosed?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/argstring/models/token.rb', line 15

def enclosed?
  @enclosed
end