Sha256: 221bd89fce7291b46c56d5a6dc7d0b4b971e3b91a58d7d7551859f79e2a9adbd

Contents?: true

Size: 814 Bytes

Versions: 3

Compression:

Stored size: 814 Bytes

Contents

module PrintReleaf
  class Deposit < Resource
    path "/deposits"

    action :find
    action :list
    action :create
    action :delete

    property :id
    property :account_id
    property :source_id
    property :date, transform_with: Transforms::Date
    property :pages, transform_with: Transforms::Integer
    property :width, transform_with: Transforms::Float
    property :height, transform_with: Transforms::Float
    property :density, transform_with: Transforms::Float
    property :paper_type_id

    def account
      @account ||= Account.find(account_id)
    end

    def source
      return nil if source_id.nil?
      @source ||= Source.find(source_id)
    end

    def paper_type
      return nil if paper_type_id.nil?
      @paper_type ||= Paper::Type.find(paper_type_id)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
printreleaf-1.0.3 lib/printreleaf/deposit.rb
printreleaf-1.0.2 lib/printreleaf/deposit.rb
printreleaf-1.0.1 lib/printreleaf/deposit.rb