Class: Kapusta::Compiler::Language::LetForm

Inherits:
Struct
  • Object
show all
Defined in:
lib/kapusta/compiler/language.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bindingsObject

Returns the value of attribute bindings

Returns:

  • (Object)

    the current value of bindings



37
38
39
# File 'lib/kapusta/compiler/language.rb', line 37

def bindings
  @bindings
end

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



37
38
39
# File 'lib/kapusta/compiler/language.rb', line 37

def body
  @body
end

Instance Method Details

#binding_pairsObject



38
39
40
41
42
# File 'lib/kapusta/compiler/language.rb', line 38

def binding_pairs
  return [] unless bindings.is_a?(Vec)

  bindings.items.each_slice(2).map { |pattern, value| [pattern, value] }
end