Sha256: 3e3686dfc0bdf30357d0c61fd0de0e0be074eb408a5db98160dd7f60e4e980a9

Contents?: true

Size: 576 Bytes

Versions: 4

Compression:

Stored size: 576 Bytes

Contents

class FutureBoard
  attr_reader :name, :description, :items

  def initialize(name:, description: nil, items: [])
    @name = name
    @description = description
    @items = items
  end

  def files
    @items.select { |item| item.class == FutureFile }
  end

  def links
    @items.select { |item| item.class == FutureLink }
  end

  def to_initial_request_params
    {
      name: name,
      description: description,
    }
  end

  def to_request_params
    {
      name: name,
      description: description,
      items: items.map(&:to_request_params),
    }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wetransfer-0.9.0.beta3 lib/we_transfer_client/future_board.rb
wetransfer-0.9.0.beta2 lib/we_transfer_client/future_board.rb
wetransfer-0.9.0.beta1 lib/we_transfer_client/future_board.rb
wetransfer-0.9.0.beta lib/we_transfer_client/future_board.rb