Module: Maven::Tools::DSL::Models
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/maven/tools/dsl/models.rb', line 33
def method_missing( m, *args )
if @model.respond_to? m
meth = @model.method m
if meth.arity == 0 && args.size == 1
@model.send( "#{m}=".to_sym, *args )
else
@model.send( m, *args )
end
else
super
end
end
|
Instance Method Details
#model ⇒ Object
25
26
27
|
# File 'lib/maven/tools/dsl/models.rb', line 25
def model
@model
end
|
#respond_to?(m) ⇒ Boolean
29
30
31
|
# File 'lib/maven/tools/dsl/models.rb', line 29
def respond_to?( m )
@model.respond_to?( m ) || @model.respond_to?( m.to_s[ 0..-2 ].to_sym )
end
|