Sha256: b7a1988c4f26d24521ab54119e4010b2bf6afedac3e89ca15c377612d880449e

Contents?: true

Size: 491 Bytes

Versions: 6

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

module All3DP
  # A "Configuration" is a set of items uploaded on All3DP.
  class Configuration
    attr_reader :id

    def initialize(id:)
      @id = id
    end

    def url
      "https://print.all3dp.com/configuration/#{id}"
    end

    def self.create(model_urls:)
      items = model_urls.map { |url| { modelUrl: url } }
      result = All3DP::API.new.create_configuration(items: items)
      new(id: result.fetch("configurationId"))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
all3dp-1.0.0 lib/all3dp/configuration.rb
all3dp-0.1.4 lib/all3dp/configuration.rb
all3dp-0.1.3 lib/all3dp/configuration.rb
all3dp-0.1.2 lib/all3dp/configuration.rb
all3dp-0.1.1 lib/all3dp/configuration.rb
all3dp-0.1.0 lib/all3dp/configuration.rb