Class: MailJack::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configuredObject

Returns the value of attribute configured.



3
4
5
# File 'lib/mail_jack/config.rb', line 3

def configured
  @configured
end

#encode_toObject

Returns the value of attribute encode_to.



3
4
5
# File 'lib/mail_jack/config.rb', line 3

def encode_to
  @encode_to
end

#href_filterObject

Returns the value of attribute href_filter.



3
4
5
# File 'lib/mail_jack/config.rb', line 3

def href_filter
  @href_filter
end

#mailersObject

Returns the value of attribute mailers.



3
4
5
# File 'lib/mail_jack/config.rb', line 3

def mailers
  @mailers
end

#trackablesObject

Returns the value of attribute trackables.



3
4
5
# File 'lib/mail_jack/config.rb', line 3

def trackables
  @trackables
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


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

def configured?
  @configured
end

#enable_encoding?Boolean

Returns:

  • (Boolean)


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

def enable_encoding?
  self.encode_to.present?
end

#trackable {|@trackables| ... } ⇒ Object

Yields:



4
5
6
7
8
9
10
11
12
# File 'lib/mail_jack/config.rb', line 4

def trackable

  # use OpenStruct for sugary assignment
  @trackables = OpenStruct.new
  yield @trackables

  #convert from a struct to a map
  @trackables = @trackables.methods(false).map(&:to_s).reject{|m| m.match(/\=$/) }.inject({}) {|hash, m| hash[m.to_sym] = @trackables.send(m); hash}
end