Sha256: aabb52e0a278cf242768dc1e3d430481bc09fcaa1fcb63e03d3d09919de5a118

Contents?: true

Size: 281 Bytes

Versions: 3

Compression:

Stored size: 281 Bytes

Contents

module VzaarApi
  module Lib
    module HasCollectionBuilder

      def self.included(base)
        base.extend(ClassMethods)
      end

      module ClassMethods
        def build(data = [])
          Array(data).map { |attrs| new attrs }
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vzaar_api-2.0.2 lib/vzaar_api/lib/has_collection_builder.rb
vzaar_api-2.0.1 lib/vzaar_api/lib/has_collection_builder.rb
vzaar_api-2.0.0 lib/vzaar_api/lib/has_collection_builder.rb