Module: Masterman::Mountable

Included in:
Base
Defined in:
lib/masterman/mountable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_loaderObject (readonly)

Returns the value of attribute class_loader.



4
5
6
# File 'lib/masterman/mountable.rb', line 4

def class_loader
  @class_loader
end

#primary_keyObject



14
15
16
# File 'lib/masterman/mountable.rb', line 14

def primary_key
  @primary_key || :id
end

Instance Method Details

#class_mount(options = {}) ⇒ Object



10
11
12
# File 'lib/masterman/mountable.rb', line 10

def class_mount(options = {})
  @class_loader = Loader.build(options)
end

#loaderObject



18
19
20
# File 'lib/masterman/mountable.rb', line 18

def loader
  @loader || MastermanError.new('not mounted or bad option given')
end

#mount(options = {}) ⇒ Object



6
7
8
# File 'lib/masterman/mountable.rb', line 6

def mount(options = {})
  @loader = Loader.build(options)
end