Class: Liquidscript::Compiler::ICR::Heredoc

Inherits:
Object
  • Object
show all
Includes:
ICR::Representable
Defined in:
lib/liquidscript/compiler/icr/heredoc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ICR::Representable

#to_a!, #to_ary, #to_sexp, #to_yaml

Constructor Details

#initialize(name, interpolate) ⇒ Heredoc

Returns a new instance of Heredoc.



11
12
13
14
15
# File 'lib/liquidscript/compiler/icr/heredoc.rb', line 11

def initialize(name, interpolate)
  @name        = name
  @interpolate = interpolate
  @body        = []
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



7
8
9
# File 'lib/liquidscript/compiler/icr/heredoc.rb', line 7

def body
  @body
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/liquidscript/compiler/icr/heredoc.rb', line 6

def name
  @name
end

Instance Method Details

#interpolate?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/liquidscript/compiler/icr/heredoc.rb', line 17

def interpolate?
  !!@interpolate
end

#to_aObject



21
22
23
# File 'lib/liquidscript/compiler/icr/heredoc.rb', line 21

def to_a
  [:heredoc, @name, @body]
end