Sha256: 2a9d97300963fabc87b4f0346b6d8fc7b284d5a67a692c1449dc602bebff9a51

Contents?: true

Size: 804 Bytes

Versions: 4

Compression:

Stored size: 804 Bytes

Contents

module AssetCloud
  class Metadata
    attr_accessor :exist, :size, :created_at, :updated_at, :value_hash, :checksum

    def new?
      !self.exist
    end

    def exist?
      self.exist
    end

    # rubocop:disable Metrics/ParameterLists
    def initialize(exist, size = nil, created_at = nil, updated_at = nil, value_hash = nil, checksum = nil)
      self.exist = exist
      self.size = size
      self.created_at = created_at
      self.updated_at = updated_at
      self.value_hash = value_hash
      self.checksum = checksum
    end
    # rubocop:enable Metrics/ParameterLists

    def self.existing
      self.new(true)
    end

    def self.non_existing
      self.new false
    end

    def inspect
      "#<#{self.class.name}: exist:#{exist} size:#{size.inspect} bytes>"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asset_cloud-2.7.1 lib/asset_cloud/metadata.rb
asset_cloud-2.7.0 lib/asset_cloud/metadata.rb
asset_cloud-2.6.1 lib/asset_cloud/metadata.rb
asset_cloud-2.6.0 lib/asset_cloud/metadata.rb