Class: Entity
- Inherits:
-
Object
- Object
- Entity
- Defined in:
- lib/ttr/objects/entity.rb
Overview
Copyright © 2011 Jesse Sielaff
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(obj) ⇒ Entity
constructor
A new instance of Entity.
Constructor Details
#initialize(obj) ⇒ Entity
Returns a new instance of Entity.
12 13 14 |
# File 'lib/ttr/objects/entity.rb', line 12 def initialize (obj) @obj = obj end |
Class Method Details
.inherited(klass) ⇒ Object
7 8 9 10 |
# File 'lib/ttr/objects/entity.rb', line 7 def Entity.inherited (klass) klass.define_singleton_method(:object) {|obj| obj.instance_variable_get(:@obj) } klass.define_singleton_method(:entities) {|ary| ary.map {|obj| klass.new(obj) } } end |