• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

What is the meaning of "class <<"?

 
Ranch Hand
Posts: 501
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In a discussion of Solitaire Cipher I found the code

The code appears to use @keystream as as an object of those methods, but I have not seen this any where.
 
Alejandro Barrero
Ranch Hand
Posts: 501
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found that an anonymous (singleton) class is associated with the specific object, so it is possible to add several methods.
 
Greenhorn
Posts: 3
Mac OS X Ruby Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alejandro Barrero wrote:I found that an anonymous (singleton) class is associated with the specific object, so it is possible to add several methods.



See this discussion:

http://openmymind.net/2010/6/25/Learning-Ruby-class-self/

I prefer creating Singleton classes using the "extend self" idiom.

Both options are described here: https://blog.engineyard.com/2015/instances-classes-and-modules
 
Is this the real life? Is this just fantasy? Is this a tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic