Class: Sortah::Handler
- Inherits:
-
Object
- Object
- Sortah::Handler
- Defined in:
- lib/sortah/handler.rb
Instance Attribute Summary collapse
-
#destinations ⇒ Object
readonly
Returns the value of attribute destinations.
-
#error_dest ⇒ Object
readonly
Returns the value of attribute error_dest.
-
#lenses ⇒ Object
readonly
Returns the value of attribute lenses.
-
#maildir ⇒ Object
readonly
Returns the value of attribute maildir.
-
#routers ⇒ Object
readonly
Returns the value of attribute routers.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #destination ⇒ Object
- #full_destination ⇒ Object
- #full_error_destination ⇒ Object
- #metadata(key) ⇒ Object
- #sort(context) ⇒ Object
Instance Attribute Details
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations.
15 16 17 |
# File 'lib/sortah/handler.rb', line 15 def destinations @destinations end |
#error_dest ⇒ Object (readonly)
Returns the value of attribute error_dest.
15 16 17 |
# File 'lib/sortah/handler.rb', line 15 def error_dest @error_dest end |
#lenses ⇒ Object (readonly)
Returns the value of attribute lenses.
15 16 17 |
# File 'lib/sortah/handler.rb', line 15 def lenses @lenses end |
#maildir ⇒ Object (readonly)
Returns the value of attribute maildir.
15 16 17 |
# File 'lib/sortah/handler.rb', line 15 def maildir @maildir end |
#routers ⇒ Object (readonly)
Returns the value of attribute routers.
15 16 17 |
# File 'lib/sortah/handler.rb', line 15 def routers @routers end |
#type ⇒ Object (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
#destination ⇒ Object
21 22 23 |
# File 'lib/sortah/handler.rb', line 21 def destination @result.destination end |
#full_destination ⇒ Object
25 26 27 |
# File 'lib/sortah/handler.rb', line 25 def full_destination maildir + destination.to_s end |
#full_error_destination ⇒ Object
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 |