Sha256: ea718978a5343b4d464dd14dd587f22bfad002c20fe49c2932d90e4b2d20f74b

Contents?: true

Size: 700 Bytes

Versions: 6

Compression:

Stored size: 700 Bytes

Contents

require 'mws/orders/parsers/service_status_message'
require 'peddler/parsers/model'

module MWS
  module Orders
    module Parsers
      class ServiceStatus < ::Peddler::Parsers::Model
        value :status do
          text_at_xpath('Status')
        end

        value :timestamp do
          time_at_xpath('Timestamp')
        end

        value :message_id do
          text_at_xpath('MessageId')
        end

        value :messages do
          xpath('Messages/Message').map { |node| ServiceStatusMessage.new(node) }
        end

        def ok?
          status == 'GREEN'
        end

        def inspect
          status
        end

        alias :to_s :inspect
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
peddler-0.6.5 lib/mws/orders/parsers/service_status.rb
peddler-0.6.4 lib/mws/orders/parsers/service_status.rb
peddler-0.6.3 lib/mws/orders/parsers/service_status.rb
peddler-0.6.2 lib/mws/orders/parsers/service_status.rb
peddler-0.6.1 lib/mws/orders/parsers/service_status.rb
peddler-0.6.0 lib/mws/orders/parsers/service_status.rb