Class: SeedPacket::Environment
- Inherits:
-
Object
- Object
- SeedPacket::Environment
- Defined in:
- lib/seed_packet/environment.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
Instance Method Summary collapse
-
#initialize(environment) ⇒ Environment
constructor
A new instance of Environment.
- #samples_allowed? ⇒ Boolean
- #scrubbing_allowed? ⇒ Boolean
- #seeding_allowed? ⇒ Boolean
Constructor Details
#initialize(environment) ⇒ Environment
Returns a new instance of Environment.
7 8 9 |
# File 'lib/seed_packet/environment.rb', line 7 def initialize(environment) self.environment = environment.to_s end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/seed_packet/environment.rb', line 5 def environment @environment end |
Instance Method Details
#samples_allowed? ⇒ Boolean
15 16 17 |
# File 'lib/seed_packet/environment.rb', line 15 def samples_allowed? %w{production test}.exclude?(environment) end |
#scrubbing_allowed? ⇒ Boolean
19 20 21 |
# File 'lib/seed_packet/environment.rb', line 19 def scrubbing_allowed? %w{development test}.include?(environment) end |
#seeding_allowed? ⇒ Boolean
11 12 13 |
# File 'lib/seed_packet/environment.rb', line 11 def seeding_allowed? environment != 'test' end |