Class: Rhom::Rhom

Inherits:
Object show all
Includes:
RhomObject
Defined in:
lib/rhom/rhom.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RhomObject

#djb_hash, #extract_options, #method_missing, #method_name_reserved?, #remove_var, #strip_braces

Constructor Details

#initializeRhom

Returns a new instance of Rhom.



37
38
39
# File 'lib/rhom/rhom.rb', line 37

def initialize
  @factory = RhomObjectFactory.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rhom::RhomObject

Instance Attribute Details

#factoryObject

Returns the value of attribute factory.



35
36
37
# File 'lib/rhom/rhom.rb', line 35

def factory
  @factory
end

Class Method Details

.client_idObject



42
43
44
45
# File 'lib/rhom/rhom.rb', line 42

def client_id
  c_id = ::Rhom::RhomDbAdapter::select_from_table('client_info','client_id')[0]
  c_id.nil? ? nil : c_id['client_id']
end

.database_full_resetObject



47
48
49
50
# File 'lib/rhom/rhom.rb', line 47

def database_full_reset
  ::Rhom::RhomDbAdapter::delete_all_from_table(TABLE_NAME)
  ::Rhom::RhomDbAdapter::delete_all_from_table('client_info')
end

.database_full_reset_and_logoutObject



52
53
54
55
# File 'lib/rhom/rhom.rb', line 52

def database_full_reset_and_logout
  database_full_reset
  SyncEngine::logout
end