Sha256: e545f8a455fbb67d3c20910942618cf68868e032b0964cce5beea25a6e5e560c

Contents?: true

Size: 819 Bytes

Versions: 3

Compression:

Stored size: 819 Bytes

Contents

module PrintReleaf
  class Quote < Resource
    path "/quotes"

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

    property :id
    property :account_id
    property :project_id
    property :transaction_id
    property :created_at,     transform_with: Transforms::Date
    property :standard_pages, transform_with: Transforms::Integer
    property :trees,          transform_with: Transforms::Float
    property :msrp_rate,      transform_with: Transforms::Float
    property :msrp_price,     transform_with: Transforms::Float
    property :items
    coerce_key :items, Array[QuoteItem]

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

    def transaction
      return nil if transaction_id.nil?
      @transaction ||= Transaction.find(transaction_id)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
printreleaf-1.3.2 lib/printreleaf/quote.rb
printreleaf-1.3.1 lib/printreleaf/quote.rb
printreleaf-1.3.0 lib/printreleaf/quote.rb