Class: PgParty::ModelInjector

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_party/model_injector.rb

Instance Method Summary collapse

Constructor Details

#initialize(model, *key, &blk) ⇒ ModelInjector

Returns a new instance of ModelInjector.



5
6
7
8
9
# File 'lib/pg_party/model_injector.rb', line 5

def initialize(model, *key, &blk)
  @model = model
  @key = key.flatten.compact
  @key_blk = blk
end

Instance Method Details

#inject_hash_methodsObject



23
24
25
26
27
# File 'lib/pg_party/model_injector.rb', line 23

def inject_hash_methods
  require "pg_party/model/hash_methods"

  inject_methods_for(PgParty::Model::HashMethods)
end

#inject_list_methodsObject



17
18
19
20
21
# File 'lib/pg_party/model_injector.rb', line 17

def inject_list_methods
  require "pg_party/model/list_methods"

  inject_methods_for(PgParty::Model::ListMethods)
end

#inject_range_methodsObject



11
12
13
14
15
# File 'lib/pg_party/model_injector.rb', line 11

def inject_range_methods
  require "pg_party/model/range_methods"

  inject_methods_for(PgParty::Model::RangeMethods)
end