Class: Griddler::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/griddler/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ccObject

Returns the value of attribute cc.



19
20
21
# File 'lib/griddler/configuration.rb', line 19

def cc
  @cc
end

#fromObject

Returns the value of attribute from.



19
20
21
# File 'lib/griddler/configuration.rb', line 19

def from
  @from
end

#processor_classObject

Returns the value of attribute processor_class.



19
20
21
# File 'lib/griddler/configuration.rb', line 19

def processor_class
  @processor_class
end

#processor_methodObject

Returns the value of attribute processor_method.



19
20
21
# File 'lib/griddler/configuration.rb', line 19

def processor_method
  @processor_method
end

#reply_delimiterObject

Returns the value of attribute reply_delimiter.



19
20
21
# File 'lib/griddler/configuration.rb', line 19

def reply_delimiter
  @reply_delimiter
end

Instance Method Details

#email_serviceObject



56
57
58
# File 'lib/griddler/configuration.rb', line 56

def email_service
  @email_service_adapter ||= adapter_class[:sendgrid]
end

#email_service=(new_email_service) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/griddler/configuration.rb', line 60

def email_service=(new_email_service)
  if new_email_service == :default
    new_email_service = :sendgrid
  end

  @email_service_adapter = adapter_class.fetch(new_email_service) { raise Griddler::Errors::EmailServiceAdapterNotFound }
end

#toObject



21
22
23
# File 'lib/griddler/configuration.rb', line 21

def to
  @to ||= :hash
end

#to=(type) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/griddler/configuration.rb', line 25

def to=(type)
  if type == :token
    Kernel.warn <<-WARN.strip_heredoc
      [Deprecation] the :token option is deprecated and will be removed in v0.6.
      For tokens use :hash and retrieve the token from email.to[:token] or choose any of [:email, :full, :hash]
    WARN
  end

  @to = type
end