Module: Hancock::Plugin::ClassMethods
- Defined in:
- lib/hancock/plugin.rb
Instance Method Summary collapse
- #active_record? ⇒ Boolean
- #model_namespace ⇒ Object
- #mongoid? ⇒ Boolean
- #orm ⇒ Object
- #orm_specific(name) ⇒ Object
Instance Method Details
#active_record? ⇒ Boolean
10 11 12 |
# File 'lib/hancock/plugin.rb', line 10 def active_record? self.orm == :active_record end |
#model_namespace ⇒ Object
13 14 15 |
# File 'lib/hancock/plugin.rb', line 13 def model_namespace "#{self}::Models::#{self.orm.to_s.camelize}".freeze end |
#mongoid? ⇒ Boolean
7 8 9 |
# File 'lib/hancock/plugin.rb', line 7 def mongoid? self.orm == :mongoid end |
#orm ⇒ Object
4 5 6 |
# File 'lib/hancock/plugin.rb', line 4 def orm Hancock.orm end |
#orm_specific(name) ⇒ Object
16 17 18 |
# File 'lib/hancock/plugin.rb', line 16 def orm_specific(name) "#{model_namespace}::#{name}".constantize end |