Class: Redwood::Location
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#each_raw_message_line(&b) ⇒ Object
much faster than raw_message.
- #hash ⇒ Object
-
#initialize(source, info) ⇒ Location
constructor
A new instance of Location.
- #labels? ⇒ Boolean
- #parsed_message ⇒ Object
- #raw_header ⇒ Object
- #raw_message ⇒ Object
- #sync_back(labels, message) ⇒ Object
- #sync_back_enabled? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(source, info) ⇒ Location
Returns a new instance of Location.
760 761 762 763 |
# File 'lib/sup/message.rb', line 760 def initialize source, info @source = source @info = info end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
758 759 760 |
# File 'lib/sup/message.rb', line 758 def info @info end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
757 758 759 |
# File 'lib/sup/message.rb', line 757 def source @source end |
Instance Method Details
#==(o) ⇒ Object
808 809 810 |
# File 'lib/sup/message.rb', line 808 def == o o.source.id == source.id and o.info == info end |
#each_raw_message_line(&b) ⇒ Object
much faster than raw_message
792 793 794 |
# File 'lib/sup/message.rb', line 792 def &b source. info, &b end |
#hash ⇒ Object
812 813 814 |
# File 'lib/sup/message.rb', line 812 def hash [source.id, info].hash end |
#labels? ⇒ Boolean
804 805 806 |
# File 'lib/sup/message.rb', line 804 def labels? source.labels? info end |
#parsed_message ⇒ Object
796 797 798 |
# File 'lib/sup/message.rb', line 796 def source. info end |
#raw_header ⇒ Object
765 766 767 |
# File 'lib/sup/message.rb', line 765 def raw_header source.raw_header info end |
#raw_message ⇒ Object
769 770 771 |
# File 'lib/sup/message.rb', line 769 def source. info end |
#sync_back(labels, message) ⇒ Object
773 774 775 776 777 778 779 780 781 782 783 784 785 |
# File 'lib/sup/message.rb', line 773 def sync_back labels, synced = false return synced unless sync_back_enabled? and valid? source.synchronize do new_info = source.sync_back(@info, labels) if new_info @info = new_info Index. , true synced = true end end synced end |
#sync_back_enabled? ⇒ Boolean
787 788 789 |
# File 'lib/sup/message.rb', line 787 def sync_back_enabled? source.respond_to? :sync_back and $config[:sync_back_to_maildir] and source.sync_back_enabled? end |
#valid? ⇒ Boolean
800 801 802 |
# File 'lib/sup/message.rb', line 800 def valid? source.valid? info end |