class Inject::Injector

Attributes

parent[RW]

Public Instance Methods

apply(target) click to toggle source
# File lib/attr_inject/injector.rb, line 16
def apply(target)
  hash = parent ? parent.merge(self) : self
  target.inject_attributes hash
end
factory(key, &block) click to toggle source
# File lib/attr_inject/injector.rb, line 11
def factory(key, &block)
  raise ArgumentError, "Block is required for factories." if block.nil?
  self[key] = block
end
map(key, val) click to toggle source
# File lib/attr_inject/injector.rb, line 7
def map(key, val)
  self[key] = val
end