Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/sixarm_ruby_to_id/object.rb
Overview
Cast an object to an id.
Instance Method Summary collapse
-
#to_i_id ⇒ Object
Cast me to an int id.
-
#to_i_ids ⇒ Object
Cast me to a list of int ids.
Instance Method Details
#to_i_id ⇒ Object
15 16 17 |
# File 'lib/sixarm_ruby_to_id/object.rb', line 15 def to_i_id object_id.to_i end |
#to_i_ids ⇒ Object
Cast me to a list of int ids.
Object.new.to_i_ids
#=> [70186724200120]
Call #object_id.to_i on the object; this is a decent default. Subclasses will override this, e.g. String, Array, Numeric, etc.
27 28 29 |
# File 'lib/sixarm_ruby_to_id/object.rb', line 27 def to_i_ids [self.to_i_id] end |