Sha256: c0cceafd18fce105b7935cf12ac0364cf8898553dde42e4b341c9730a574a238

Contents?: true

Size: 702 Bytes

Versions: 2

Compression:

Stored size: 702 Bytes

Contents

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

module MWS
  module Sellers
    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

2 entries across 2 versions & 1 rubygems

Version Path
peddler-0.6.5 lib/mws/sellers/parsers/service_status.rb
peddler-0.6.4 lib/mws/sellers/parsers/service_status.rb