Sha256: c6b4ddac4a23f60923a30b4bce5aae5002bf1efefd65a8e8664c07b5b2a95062

Contents?: true

Size: 652 Bytes

Versions: 7

Compression:

Stored size: 652 Bytes

Contents

module PrintReleaf
  class Certificate < Resource
    path "/certificates"

    action :find
    action :list

    property :id
    property :account_id
    property :period_start, transform_with: Transforms::Date
    property :period_end, transform_with: Transforms::Date
    property :pages, transform_with: Transforms::Integer
    property :trees, transform_with: Transforms::Float
    property :project_id
    property :project
    coerce_key :project, Forestry::Project

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

    def project
      @project ||= self[:project] || Forestry::Project.find(project_id)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
printreleaf-1.5.0 lib/printreleaf/certificate.rb
printreleaf-1.3.2 lib/printreleaf/certificate.rb
printreleaf-1.3.1 lib/printreleaf/certificate.rb
printreleaf-1.3.0 lib/printreleaf/certificate.rb
printreleaf-1.0.3 lib/printreleaf/certificate.rb
printreleaf-1.0.2 lib/printreleaf/certificate.rb
printreleaf-1.0.1 lib/printreleaf/certificate.rb