class EndiciaLabelServer::Parsers::PostageRateParser
Attributes
rated_shipments[RW]
Public Class Methods
new()
click to toggle source
Calls superclass method
EndiciaLabelServer::Parsers::ParserBase::new
# File lib/endicia_label_server/parsers/postage_rate_parser.rb, line 6 def initialize super self.rated_shipments = [] @current_rate = {} end
Public Instance Methods
end_element(name)
click to toggle source
Calls superclass method
EndiciaLabelServer::Parsers::ParserBase#end_element
# File lib/endicia_label_server/parsers/postage_rate_parser.rb, line 16 def end_element(name) super return unless name == :Postage rated_shipments << @current_rate @current_rate = {} end
parse_mail_service(value)
click to toggle source
# File lib/endicia_label_server/parsers/postage_rate_parser.rb, line 32 def parse_mail_service(value) service_code = EndiciaLabelServer::SERVICES.invert[value.as_s] @current_rate[:service_code] = service_code @current_rate[:service_name] = value.as_s end
parse_total_charges(value)
click to toggle source
# File lib/endicia_label_server/parsers/postage_rate_parser.rb, line 38 def parse_total_charges(value) @current_rate[:total] = value.as_s end
start_element(name)
click to toggle source
Calls superclass method
EndiciaLabelServer::Parsers::ParserBase#start_element
# File lib/endicia_label_server/parsers/postage_rate_parser.rb, line 12 def start_element(name) super end
value(value)
click to toggle source
Calls superclass method
EndiciaLabelServer::Parsers::ParserBase#value
# File lib/endicia_label_server/parsers/postage_rate_parser.rb, line 23 def value(value) super if switch_active?(:Postage, :MailService) parse_mail_service value elsif switch_active?(:Postage, :Rate) parse_total_charges value end end