Class: Trackman::Assets::RemoteAsset

Inherits:
Asset
  • Object
show all
Extended by:
RemoteAssetFactory
Includes:
Persistence::Remote
Defined in:
lib/trackman/assets/remote_asset.rb

Defined Under Namespace

Classes: AssetIO

Constant Summary

Constants included from Components::Conventions

Components::Conventions::Asset

Instance Attribute Summary collapse

Attributes inherited from Asset

#assets, #path, #virtual_path

Instance Method Summary collapse

Methods included from RemoteAssetFactory

retrieve_parent

Methods included from AssetFactory

#add_content_behavior, #asset_pipeline_enabled?, #create, #rails_defined?, #retrieve_parent

Methods included from Persistence::Remote

#delete, included, #insert, #update

Methods inherited from Asset

#<=>, all, autosync, #is_child_of, sync, #to_remote, #to_s

Methods included from Components::Conventions

#error_page, #error_path, #maintenance_page, #maintenance_path

Methods included from Components::Shippable

#ship

Methods included from Components::Diffable

#diff, #old_diff

Constructor Details

#initialize(attributes = {}) ⇒ RemoteAsset

Returns a new instance of RemoteAsset.



12
13
14
15
16
17
18
# File 'lib/trackman/assets/remote_asset.rb', line 12

def initialize attributes = {}
  ensure_config
  super

  @id = attributes[:id]
  @file_hash = attributes[:file_hash]
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/trackman/assets/remote_asset.rb', line 10

def id
  @id
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/trackman/assets/remote_asset.rb', line 24

def ==(other)
  result = super
  if result
    if other.is_a? RemoteAsset
      result = other.id == id && other.file_hash == file_hash 
    end
  end
  result 
end

#validate_path?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/trackman/assets/remote_asset.rb', line 20

def validate_path?
  false
end