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.
- #fallback_date ⇒ Object
- #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.
770 771 772 773 |
# File 'lib/sup/message.rb', line 770 def initialize source, info @source = source @info = info end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
768 769 770 |
# File 'lib/sup/message.rb', line 768 def info @info end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
767 768 769 |
# File 'lib/sup/message.rb', line 767 def source @source end |
Instance Method Details
#==(o) ⇒ Object
822 823 824 |
# File 'lib/sup/message.rb', line 822 def == o o.source.id == source.id and o.info == info end |
#each_raw_message_line(&b) ⇒ Object
much faster than raw_message
802 803 804 |
# File 'lib/sup/message.rb', line 802 def &b source. info, &b end |
#fallback_date ⇒ Object
810 811 812 |
# File 'lib/sup/message.rb', line 810 def fallback_date source. info end |
#hash ⇒ Object
826 827 828 |
# File 'lib/sup/message.rb', line 826 def hash [source.id, info].hash end |
#labels? ⇒ Boolean
818 819 820 |
# File 'lib/sup/message.rb', line 818 def labels? source.labels? info end |
#parsed_message ⇒ Object
806 807 808 |
# File 'lib/sup/message.rb', line 806 def source. info end |
#raw_header ⇒ Object
775 776 777 |
# File 'lib/sup/message.rb', line 775 def raw_header source.raw_header info end |
#raw_message ⇒ Object
779 780 781 |
# File 'lib/sup/message.rb', line 779 def source. info end |
#sync_back(labels, message) ⇒ Object
783 784 785 786 787 788 789 790 791 792 793 794 795 |
# File 'lib/sup/message.rb', line 783 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
797 798 799 |
# File 'lib/sup/message.rb', line 797 def sync_back_enabled? source.respond_to? :sync_back and $config[:sync_back_to_maildir] and source.sync_back_enabled? end |
#valid? ⇒ Boolean
814 815 816 |
# File 'lib/sup/message.rb', line 814 def valid? source.valid? info end |