Class: BinderCore::Asset
- Inherits:
-
Object
- Object
- BinderCore::Asset
- Defined in:
- lib/binder_core/asset.rb
Instance Attribute Summary collapse
-
#asset_url ⇒ Object
Returns the value of attribute asset_url.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
- #feed_path ⇒ Object
-
#initialize(path) ⇒ Asset
constructor
A new instance of Asset.
- #set_route(route) ⇒ Object
- #with_name(value) ⇒ Object
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_url ⇒ Object
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_url ⇒ Object
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/binder_core/asset.rb', line 3 def base_url @base_url end |
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/binder_core/asset.rb', line 3 def file @file end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/binder_core/asset.rb', line 3 def name @name end |
#route ⇒ Object
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_path ⇒ Object
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 |