Class: Atomy::Code::Pattern::Splat

Inherits:
Atomy::Code::Pattern show all
Defined in:
lib/atomy/code/pattern/splat.rb

Instance Attribute Summary

Attributes inherited from Atomy::Code::Pattern

#node

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ Splat

Returns a new instance of Splat.



8
9
10
# File 'lib/atomy/code/pattern/splat.rb', line 8

def initialize(pattern)
  @pattern = pattern
end

Instance Method Details

#assign(gen) ⇒ Object



21
22
23
# File 'lib/atomy/code/pattern/splat.rb', line 21

def assign(gen)
  @pattern.assign(gen)
end

#bytecode(gen, mod) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/atomy/code/pattern/splat.rb', line 12

def bytecode(gen, mod)
  gen.push_cpath_top
  gen.find_const(:Atomy)
  gen.find_const(:Pattern)
  gen.find_const(:Splat)
  mod.compile(gen, @pattern)
  gen.send(:new, 1)
end

#splat?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/atomy/code/pattern/splat.rb', line 25

def splat?
  true
end