Class: Sourcify::Common::Parser::RawScanner::DString

Inherits:
Struct
  • Object
show all
Defined in:
lib/sourcify/lib/sourcify/common/parser/raw_scanner/dstring.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encodingObject

Returns the value of attribute encoding

Returns:

  • (Object)

    the current value of encoding



5
6
7
# File 'lib/sourcify/lib/sourcify/common/parser/raw_scanner/dstring.rb', line 5

def encoding
  @encoding
end

#tagObject

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



5
6
7
# File 'lib/sourcify/lib/sourcify/common/parser/raw_scanner/dstring.rb', line 5

def tag
  @tag
end

#typeObject (readonly)

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



9
10
11
# File 'lib/sourcify/lib/sourcify/common/parser/raw_scanner/dstring.rb', line 9

def type
  @type
end

Instance Method Details

#<<(content) ⇒ Object



11
12
13
# File 'lib/sourcify/lib/sourcify/common/parser/raw_scanner/dstring.rb', line 11

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

#closed?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/sourcify/lib/sourcify/common/parser/raw_scanner/dstring.rb', line 19

def closed?
  evaluable? && parsable?
end

#to_sObject



15
16
17
# File 'lib/sourcify/lib/sourcify/common/parser/raw_scanner/dstring.rb', line 15

def to_s
  @contents.join
end