Class: PgParty::ModelInjector
- Inherits:
-
Object
- Object
- PgParty::ModelInjector
- Defined in:
- lib/pg_party/model_injector.rb
Instance Method Summary collapse
-
#initialize(model, *key, &blk) ⇒ ModelInjector
constructor
A new instance of ModelInjector.
- #inject_hash_methods ⇒ Object
- #inject_list_methods ⇒ Object
- #inject_range_methods ⇒ Object
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_methods ⇒ Object
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_methods ⇒ Object
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_methods ⇒ Object
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 |