Object
# File lib/mail/encodings/transfer_encoding.rb, line 18 18: def self.can_encode?(enc) 19: can_transport? enc 20: end
# File lib/mail/encodings/transfer_encoding.rb, line 9 9: def self.can_transport?(enc) 10: enc = Encodings.get_name(enc) 11: if Encodings.defined? enc 12: Encodings.get_encoding(enc).new.is_a? self 13: else 14: false 15: end 16: end
# File lib/mail/encodings/transfer_encoding.rb, line 22 22: def self.cost(str) 23: raise "Unimplemented" 24: end
# File lib/mail/encodings/transfer_encoding.rb, line 30 30: def self.get_best_compatible(source_encoding, str) 31: if self.can_transport? source_encoding then 32: source_encoding 33: else 34: choices = [] 35: Encodings.get_all.each do |enc| 36: choices << enc if self.can_transport? enc and enc.can_encode? source_encoding 37: end 38: best = nil 39: best_cost = 100 40: choices.each do |enc| 41: this_cost = enc.cost str 42: if this_cost < best_cost then 43: best_cost = this_cost 44: best = enc 45: elsif this_cost == best_cost then 46: best = enc if enc::PRIORITY < best::PRIORITY 47: end 48: end 49: best 50: end 51: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.