Class: Sourcify::Proc::Scanner::DString

Inherits:
Struct
  • Object
show all
Defined in:
lib/sourcify/proc/scanner/dstring.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagObject

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



4
5
6
# File 'lib/sourcify/proc/scanner/dstring.rb', line 4

def tag
  @tag
end

#typeObject (readonly)

To suppress ‘warning: Object#type is deprecated; use Object#class’ when evaluating string



8
9
10
# File 'lib/sourcify/proc/scanner/dstring.rb', line 8

def type
  @type
end

Instance Method Details

#<<(content) ⇒ Object



10
11
12
# File 'lib/sourcify/proc/scanner/dstring.rb', line 10

def <<(content)
  (@contents ||= []) << content
end

#closed?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/sourcify/proc/scanner/dstring.rb', line 18

def closed?
  evaluable? && parsable?
end

#to_sObject



14
15
16
# File 'lib/sourcify/proc/scanner/dstring.rb', line 14

def to_s
  @contents.join
end