Class: SeedPacket::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/seed_packet/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#environmentObject

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/seed_packet/environment.rb', line 15

def samples_allowed?
  %w{production test}.exclude?(environment)
end

#scrubbing_allowed?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/seed_packet/environment.rb', line 19

def scrubbing_allowed?
  %w{development test}.include?(environment)
end

#seeding_allowed?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/seed_packet/environment.rb', line 11

def seeding_allowed?
  environment != 'test'
end