Class: MailJack::Config
- Inherits:
-
Object
- Object
- MailJack::Config
- Defined in:
- lib/mail_jack/config.rb
Instance Attribute Summary collapse
-
#configured ⇒ Object
Returns the value of attribute configured.
-
#encode_to ⇒ Object
Returns the value of attribute encode_to.
-
#href_filter ⇒ Object
Returns the value of attribute href_filter.
-
#mailers ⇒ Object
Returns the value of attribute mailers.
-
#trackables ⇒ Object
Returns the value of attribute trackables.
Instance Method Summary collapse
Instance Attribute Details
#configured ⇒ Object
Returns the value of attribute configured.
3 4 5 |
# File 'lib/mail_jack/config.rb', line 3 def configured @configured end |
#encode_to ⇒ Object
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_filter ⇒ Object
Returns the value of attribute href_filter.
3 4 5 |
# File 'lib/mail_jack/config.rb', line 3 def href_filter @href_filter end |
#mailers ⇒ Object
Returns the value of attribute mailers.
3 4 5 |
# File 'lib/mail_jack/config.rb', line 3 def mailers @mailers end |
#trackables ⇒ Object
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
18 19 20 |
# File 'lib/mail_jack/config.rb', line 18 def configured? @configured end |
#enable_encoding? ⇒ Boolean
14 15 16 |
# File 'lib/mail_jack/config.rb', line 14 def enable_encoding? self.encode_to.present? end |
#trackable {|@trackables| ... } ⇒ Object
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 |