Class: Rubernate::Init
- Inherits:
-
Object
- Object
- Rubernate::Init
- Defined in:
- lib/rubernate/init.rb
Instance Attribute Summary collapse
-
#bytecode ⇒ Object
Returns the value of attribute bytecode.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#hibernate_classes ⇒ Object
Returns the value of attribute hibernate_classes.
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
- #bytecode_provider ⇒ Object
- #connect(connection) ⇒ Object
-
#initialize ⇒ Init
constructor
A new instance of Init.
- #load_classes(*classes) ⇒ Object
Constructor Details
#initialize ⇒ Init
Returns a new instance of Init.
15 16 17 18 19 20 |
# File 'lib/rubernate/init.rb', line 15 def initialize self.hibernate_classes = [] bytecode_provider end |
Instance Attribute Details
#bytecode ⇒ Object
Returns the value of attribute bytecode.
13 14 15 |
# File 'lib/rubernate/init.rb', line 13 def bytecode @bytecode end |
#connection ⇒ Object
Returns the value of attribute connection.
13 14 15 |
# File 'lib/rubernate/init.rb', line 13 def connection @connection end |
#hibernate_classes ⇒ Object
Returns the value of attribute hibernate_classes.
13 14 15 |
# File 'lib/rubernate/init.rb', line 13 def hibernate_classes @hibernate_classes end |
#parser ⇒ Object
Returns the value of attribute parser.
13 14 15 |
# File 'lib/rubernate/init.rb', line 13 def parser @parser end |
Instance Method Details
#bytecode_provider ⇒ Object
36 37 38 39 |
# File 'lib/rubernate/init.rb', line 36 def bytecode_provider self.bytecode ||= Bytecode.new self.bytecode end |
#connect(connection) ⇒ Object
31 32 33 34 |
# File 'lib/rubernate/init.rb', line 31 def connect(connection) self.connection= Connection.new(connection, self.hibernate_classes) self.connection.entity_manager_factory end |
#load_classes(*classes) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/rubernate/init.rb', line 23 def load_classes(*classes) classes.each do |clazz| self.hibernate_classes << ClassParser.new(clazz,self.bytecode).to_class end end |