Now your problem is the add method that returns a lambda, and lambdas
doesn't have the method one.
Why do you use a lambda? I don't think it could work for what you're doing,
but maybe some ruby-expert could help us.



On Sat, Jun 14, 2014 at 5:17 PM, Roelof Wobben <r.wobben / home.nl> wrote:

> Emanuele DelBono schreef op 14-6-2014 16:26:
>
>  def self.one
>>   @@first_number = 1
>>   self
>> end
>>
>
> Still it do not work.
>
> I have now this :
>
> class Calc
>
>   def self.one
>
>      @@first_number = 1
>      self
>   end
>
>   def self.add
>     -> (y) {x+y}
>   end
>
> end
>
> Calc.one.add.one
>
> And now I see this errror message
>
> main.rb:16:in `': undefined method `one' for #  (NoMethodError)
>
>
> Roelof
>
>
>


-- 
ema
http://ema.codiceplastico.com <http://blog.codiceplastico.com/ema>