Sha256: 9bba7d0fbc23d55b6f92f14cc9f42f3e2e48cce4fc865b6aecee26c7c9e53fee

Contents?: true

Size: 427 Bytes

Versions: 9

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

module NovaposhtaApi
  class Model < Hashie::Trash
    include Hashie::Extensions::IndifferentAccess
    include Hashie::Extensions::IgnoreUndeclared

    class << self
      def extract_collection(data)
        NovaposhtaApi::Collection.new(data, self)
      end

      def extract_single(data)
        item = data.is_a?(Array) ? data.first : data

        new(item)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
novaposhta_api-0.1.9 lib/novaposhta_api/model.rb
novaposhta_api-0.1.8 lib/novaposhta_api/model.rb
novaposhta_api-0.1.7 lib/novaposhta_api/model.rb
novaposhta_api-0.1.5 lib/novaposhta_api/model.rb
novaposhta_api-0.1.4 lib/novaposhta_api/model.rb
novaposhta_api-0.1.3 lib/novaposhta_api/model.rb
novaposhta_api-0.1.2 lib/novaposhta_api/model.rb
novaposhta_api-0.1.1 lib/novaposhta_api/model.rb
novaposhta_api-0.1.0 lib/novaposhta_api/model.rb