Class: MailRoom::Delivery::Que::Options

Inherits:
Struct
  • Object
show all
Defined in:
lib/mail_room/delivery/que.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mailbox) ⇒ Options

Returns a new instance of Options.


10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/mail_room/delivery/que.rb', line 10

def initialize(mailbox)
  host = mailbox.delivery_options[:host] || "localhost"
  port = mailbox.delivery_options[:port] || 5432
  database = mailbox.delivery_options[:database]
  username = mailbox.delivery_options[:username]
  password = mailbox.delivery_options[:password]

  queue = mailbox.delivery_options[:queue] || ''
  priority = mailbox.delivery_options[:priority] || 100 # lowest priority for Que
  job_class = mailbox.delivery_options[:job_class]
  logger = mailbox.logger

  super(host, port, database, username, password, queue, priority, job_class, logger)
end

Instance Attribute Details

#databaseObject

Returns the value of attribute database

Returns:

  • (Object)

    the current value of database


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def database
  @database
end

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def host
  @host
end

#job_classObject

Returns the value of attribute job_class

Returns:

  • (Object)

    the current value of job_class


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def job_class
  @job_class
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def logger
  @logger
end

#passwordObject

Returns the value of attribute password

Returns:

  • (Object)

    the current value of password


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def password
  @password
end

#portObject

Returns the value of attribute port

Returns:

  • (Object)

    the current value of port


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def port
  @port
end

#priorityObject

Returns the value of attribute priority

Returns:

  • (Object)

    the current value of priority


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def priority
  @priority
end

#queueObject

Returns the value of attribute queue

Returns:

  • (Object)

    the current value of queue


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def queue
  @queue
end

#usernameObject

Returns the value of attribute username

Returns:

  • (Object)

    the current value of username


9
10
11
# File 'lib/mail_room/delivery/que.rb', line 9

def username
  @username
end