Sha256: b65c6061c1a283e7c04bb8a7a706020c629839ecdd210a0213d4c75f65cdb31a

Contents?: true

Size: 844 Bytes

Versions: 1

Compression:

Stored size: 844 Bytes

Contents

module RestFtpDaemon
  module API
    module Entities

      class JobPresenter < Grape::Entity
        # Job ID
        expose :id

        # Job specific attributes
        Job::FIELDS.each do |field|
          expose field
          #expose field, unless: lambda { |object, options| object.instance_variable_get("@#{field}").nil? }
        end

        # Technical fields
        expose :wid, unless: lambda { |object, options| object.wid.nil? }

        expose :error
        expose :status
        expose :queued_at
        expose :updated_at
        expose :started_at
        expose :finished_at

        # Computed fields
        expose :age
        expose :exectime

        # Params
        # expose :wid, unless: lambda { |object, options| object.wid.nil? }
        expose :params, unless: :hide_params

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rest-ftp-daemon-0.100.2 lib/rest-ftp-daemon/api/job_presenter.rb