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

#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

#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



48
49
50
# File 'lib/griddler/configuration.rb', line 48

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

#email_service=(new_email_service) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/griddler/configuration.rb', line 52

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