Class: Sortah::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/sortah/handler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#destinationsObject (readonly)

Returns the value of attribute destinations.



15
16
17
# File 'lib/sortah/handler.rb', line 15

def destinations
  @destinations
end

#error_destObject (readonly)

Returns the value of attribute error_dest.



15
16
17
# File 'lib/sortah/handler.rb', line 15

def error_dest
  @error_dest
end

#lensesObject (readonly)

Returns the value of attribute lenses.



15
16
17
# File 'lib/sortah/handler.rb', line 15

def lenses
  @lenses
end

#maildirObject (readonly)

Returns the value of attribute maildir.



15
16
17
# File 'lib/sortah/handler.rb', line 15

def maildir
  @maildir
end

#routersObject (readonly)

Returns the value of attribute routers.



15
16
17
# File 'lib/sortah/handler.rb', line 15

def routers
  @routers
end

#typeObject (readonly)

Returns the value of attribute type.



15
16
17
# File 'lib/sortah/handler.rb', line 15

def type
  @type
end

Class Method Details

.build_from(context) ⇒ Object



4
5
6
# File 'lib/sortah/handler.rb', line 4

def self.build_from(context)
  new(context)
end

Instance Method Details

#destinationObject



21
22
23
# File 'lib/sortah/handler.rb', line 21

def destination
  @result.destination
end

#full_destinationObject



25
26
27
# File 'lib/sortah/handler.rb', line 25

def full_destination
  maildir + destination.to_s
end

#full_error_destinationObject



29
30
31
# File 'lib/sortah/handler.rb', line 29

def full_error_destination
  maildir + error_dest.to_s
end

#metadata(key) ⇒ Object



17
18
19
# File 'lib/sortah/handler.rb', line 17

def (key)
  @result.(key)
end

#sort(context) ⇒ Object



8
9
10
11
12
13
# File 'lib/sortah/handler.rb', line 8

def sort(context)
  raise NoRootRouterException unless @routers.has_root?    
  clear_state!
  @result = CleanRoom.sort(context, self)
  self
end