Module: PrintStuffMail

Defined in:
lib/psm.rb,
lib/psm/session.rb

Defined Under Namespace

Classes: Confirmation, Session

Constant Summary collapse

BASE_URL =
's.copypastel.com'

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.account_idObject

Returns the value of attribute account_id.



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

def 
  @account_id
end

Class Method Details

.mail!(message, address, return_address = nil) {|c = Confirmation.new| ... } ⇒ Object

Yields:

Raises:

  • (SecurityError)


21
22
23
24
25
26
27
28
29
30
# File 'lib/psm.rb', line 21

def mail!( message, address, return_address = nil )
  raise(SecurityError, 'no account_id set.') unless 
  raise(SecurityError, 'need to confirm!') unless block_given?
  yield c = Confirmation.new
  raise(SecurityError, 'need to confirm!') unless c.confirmed?
  
  @session ||= Session.new 
  raise unless @session.active? or @session.renew! # needs an error type
  post_letter(message, address, return_address)
end

Instance Method Details

#mail!(message, return_address = nil, &block) ⇒ Object



54
55
56
# File 'lib/psm.rb', line 54

def mail!( message, return_address = nil, &block )
  PSM.mail!( message, self.address, return_address, block)
end