On Wed, Jun 16, 2010 at 11:31 AM, Ralph Shnelvar <ralphs / dos32.com> wrote:
>
> Is there some way to set the, uh, environment so that "self" need not be
> repeated?
Only by changing your paradigm and by defining setters like these

%w{ step taxes what }.each do | att_name |
   define_method att_name do | *args |
      return instance_variable_get( "@#{att_name}") if args.empty?
      instance_variable_set( "@#{att_name}", args.first)
   end
end

def tax *values
    return @tax if values.empty?
    @tax = valeus.first
end
....

HTH
R

>
> (Joke: Hmm, if you get rid of your self, do you commit suicide?)
Depends on how many selves you got (cats have 7 IIRC).
>
>
>



-- 
The best way to predict the future is to invent it.
-- Alan Kay