Module: SeedPacket
- Defined in:
- lib/seed_packet.rb,
lib/seed_packet/version.rb,
lib/seed_packet/environment.rb
Defined Under Namespace
Classes: Environment
Constant Summary collapse
- VERSION =
'0.0.5'
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#factory_class ⇒ Object
Returns the value of attribute factory_class.
Instance Method Summary collapse
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
6 7 8 |
# File 'lib/seed_packet.rb', line 6 def environment @environment end |
#factory_class ⇒ Object
Returns the value of attribute factory_class.
6 7 8 |
# File 'lib/seed_packet.rb', line 6 def factory_class @factory_class end |
Instance Method Details
#initialize(options = {}) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/seed_packet.rb', line 9 def initialize( = {}) self.environment = .key?(:environment) ? Environment.new(environment) : nil if environment.samples_allowed? self.factory_class = Object.const_get(.fetch(:factory_class, 'FactoryGirl')) end end |
#sample ⇒ Object
23 24 25 26 27 |
# File 'lib/seed_packet.rb', line 23 def sample if environment.samples_allowed? yield end end |
#scrub ⇒ Object
29 30 31 32 33 |
# File 'lib/seed_packet.rb', line 29 def scrub if environment.scrubbing_allowed? yield end end |
#seed ⇒ Object
17 18 19 20 21 |
# File 'lib/seed_packet.rb', line 17 def seed if environment.seeding_allowed? yield end end |