Class: Loom::MethodSignature::MatchSpec::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/loom/method_signature.rb

Instance Method Summary collapse

Constructor Details

#initializeBuilder

Returns a new instance of Builder.



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/loom/method_signature.rb', line 49

def initialize
  @map = {
    :req_args => 0,
    :opt_args => 0,
    :has_rest_args => false,
    :keyreq_args => 0,
    :key_args => 0,
    :has_keyrest_args => false,
    :has_block => false
  }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, value, *args) ⇒ Object



61
62
63
64
# File 'lib/loom/method_signature.rb', line 61

def method_missing(name, value, *args)
  @map[name.to_sym] = value
  self
end

Instance Method Details

#buildObject



66
67
68
# File 'lib/loom/method_signature.rb', line 66

def build
  MatchSpec.new(@map || {})
end