Class: MailEnvi::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/mail_envi/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Config

Returns a new instance of Config.



13
14
15
16
# File 'lib/mail_envi/config.rb', line 13

def initialize &block
  @environments = ['development']
  instance_eval(&block) if block_given?
end

Instance Attribute Details

#default_toObject

Returns the value of attribute default_to.



18
19
20
# File 'lib/mail_envi/config.rb', line 18

def default_to
  @default_to
end

#environmentsObject (readonly)

Returns the value of attribute environments.



19
20
21
# File 'lib/mail_envi/config.rb', line 19

def environments
  @environments
end

#interceptorObject

Returns the value of attribute interceptor.



18
19
20
# File 'lib/mail_envi/config.rb', line 18

def interceptor
  @interceptor
end

Class Method Details

.instanceObject



4
5
6
# File 'lib/mail_envi/config.rb', line 4

def instance
  @instance
end

.set(&block) ⇒ Object



8
9
10
# File 'lib/mail_envi/config.rb', line 8

def set(&block)
  @instance = new(&block)
end

Instance Method Details

#include_environments(envs = []) ⇒ Object



25
26
27
# File 'lib/mail_envi/config.rb', line 25

def include_environments(envs = [])
  @environments+= envs.map(&:to_s) if envs && envs.any?
end