Class: BinderCore::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/binder_core/asset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Asset

Returns a new instance of Asset.



5
6
7
8
9
10
# File 'lib/binder_core/asset.rb', line 5

def initialize(path)
  @file   = BinderCore::FileRef.new path
  self.name = file.name
  @route = []
  @base_url = ""
end

Instance Attribute Details

#asset_urlObject

Returns the value of attribute asset_url.



3
4
5
# File 'lib/binder_core/asset.rb', line 3

def asset_url
  @asset_url
end

#base_urlObject

Returns the value of attribute base_url.



3
4
5
# File 'lib/binder_core/asset.rb', line 3

def base_url
  @base_url
end

#fileObject

Returns the value of attribute file.



3
4
5
# File 'lib/binder_core/asset.rb', line 3

def file
  @file
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/binder_core/asset.rb', line 3

def name
  @name
end

#routeObject

Returns the value of attribute route.



3
4
5
# File 'lib/binder_core/asset.rb', line 3

def route
  @route
end

Instance Method Details

#feed_pathObject



22
23
24
# File 'lib/binder_core/asset.rb', line 22

def feed_path
  [ *route, name ].join("/")
end

#set_route(route) ⇒ Object



26
27
28
29
30
31
# File 'lib/binder_core/asset.rb', line 26

def set_route(route)
  @route = route
  @route.freeze
  refresh_asset_url
  route
end

#with_name(value) ⇒ Object



12
13
14
15
# File 'lib/binder_core/asset.rb', line 12

def with_name(value)
  self.name = value
  self
end