S
Stephane Wirtel
Hi all,
How to define the assignment operator for a class ?
irb(main):012:0> class Test
irb(main):013:1> def = other
irb(main):014:2> puts other.class
irb(main):015:2> end
irb(main):016:1> end
SyntaxError: compile error
(irb):13: syntax error, unexpected '='
def = other
^
(irb):16: syntax error, unexpected kEND, expecting $end from (irb):16
Is there a way to solve my issue ?
Where is my mistake ?
I don't believe that's possible to assign something to an instance
Best Regards,
Stephane
How to define the assignment operator for a class ?
irb(main):012:0> class Test
irb(main):013:1> def = other
irb(main):014:2> puts other.class
irb(main):015:2> end
irb(main):016:1> end
SyntaxError: compile error
(irb):13: syntax error, unexpected '='
def = other
^
(irb):16: syntax error, unexpected kEND, expecting $end from (irb):16
Is there a way to solve my issue ?
Where is my mistake ?
I don't believe that's possible to assign something to an instance
Best Regards,
Stephane