Class: Atomy::Code::Pattern::Wildcard

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

Instance Attribute Summary

Attributes inherited from Atomy::Code::Pattern

#node

Instance Method Summary collapse

Methods inherited from Atomy::Code::Pattern

#splat?

Constructor Details

#initialize(name = nil, set = false) ⇒ Wildcard

Returns a new instance of Wildcard.



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

def initialize(name = nil, set = false)
  @name = name
  @set = set
end

Instance Method Details

#assign(gen) ⇒ Object



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

def assign(gen)
  assignment_local(gen, @name, @set).set_bytecode(gen)
end

#bytecode(gen, mod) ⇒ Object



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

def bytecode(gen, mod)
  gen.push_cpath_top
  gen.find_const(:Atomy)
  gen.find_const(:Pattern)
  gen.find_const(:Wildcard)
  gen.send(:new, 0)
end