Sha256: 25c42cc8a9440faab161b4893ae52da68b41f3ba27bdf2de4d79370f089eb72f

Contents?: true

Size: 430 Bytes

Versions: 1

Compression:

Stored size: 430 Bytes

Contents

require "russianpost/client"
require "russianpost/operations_factory"

module RussianPost
  class Parcel
    attr_reader :barcode, :client

    def initialize(barcode, client: Client)
      @barcode = barcode
      @client  = client.new
    end

    def operations
      @operations ||= fetch_operations
    end

    private

    def fetch_operations
      OperationsFactory.build(client.call(barcode: barcode))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
russianpost-0.1.0 lib/russianpost/parcel.rb