Class: Kangaroo::RubyAdapter::Base
- Inherits:
-
Object
- Object
- Kangaroo::RubyAdapter::Base
- Includes:
- ClassDefinition, Fields
- Defined in:
- lib/kangaroo/ruby_adapter/base.rb
Instance Attribute Summary collapse
-
#oo_model ⇒ Object
Returns the value of attribute oo_model.
-
#root_namespace ⇒ Object
Returns the value of attribute root_namespace.
Instance Method Summary collapse
-
#initialize(model) ⇒ Base
constructor
A new instance of Base.
-
#to_ruby ⇒ Object
Adapt the OpenERP model to ruby.
Methods included from Fields
Methods included from ClassDefinition
Constructor Details
#initialize(model) ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/kangaroo/ruby_adapter/base.rb', line 12 def initialize model @oo_model = model @root_namespace = model.class.namespace end |
Instance Attribute Details
#oo_model ⇒ Object
Returns the value of attribute oo_model.
10 11 12 |
# File 'lib/kangaroo/ruby_adapter/base.rb', line 10 def oo_model @oo_model end |
#root_namespace ⇒ Object
Returns the value of attribute root_namespace.
10 11 12 |
# File 'lib/kangaroo/ruby_adapter/base.rb', line 10 def root_namespace @root_namespace end |
Instance Method Details
#to_ruby ⇒ Object
Adapt the OpenERP model to ruby
return [Class] A Kangaroo::Model::Base subclass representing the OpenERP model
20 21 22 23 24 25 |
# File 'lib/kangaroo/ruby_adapter/base.rb', line 20 def to_ruby define_class add_fields @ruby_model end |