Module: Fig::Statement::Asset
Overview
Some sort of file to be included in a package.
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Class Method Summary collapse
Instance Method Summary collapse
- #glob_if_not_url? ⇒ Boolean
- #is_asset? ⇒ Boolean
- #minimum_grammar_for_emitting_input ⇒ Object
- #minimum_grammar_for_publishing ⇒ Object
- #requires_globbing? ⇒ Boolean
- #standard_asset_name ⇒ Object
- #urls ⇒ Object
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
12 13 14 |
# File 'lib/fig/statement/asset.rb', line 12 def location @location end |
Class Method Details
.included(class_included_into) ⇒ Object
14 15 16 17 18 |
# File 'lib/fig/statement/asset.rb', line 14 def self.included(class_included_into) class_included_into.extend(ClassMethods) return end |
Instance Method Details
#glob_if_not_url? ⇒ Boolean
20 21 22 |
# File 'lib/fig/statement/asset.rb', line 20 def glob_if_not_url?() return @glob_if_not_url end |
#is_asset? ⇒ Boolean
28 29 30 |
# File 'lib/fig/statement/asset.rb', line 28 def is_asset?() return true end |
#minimum_grammar_for_emitting_input ⇒ Object
48 49 50 |
# File 'lib/fig/statement/asset.rb', line 48 def minimum_grammar_for_emitting_input() return minimum_grammar_for_value location end |
#minimum_grammar_for_publishing ⇒ Object
52 53 54 |
# File 'lib/fig/statement/asset.rb', line 52 def minimum_grammar_for_publishing() return minimum_grammar_for_value asset_name end |
#requires_globbing? ⇒ Boolean
32 33 34 |
# File 'lib/fig/statement/asset.rb', line 32 def requires_globbing?() return glob_if_not_url? && ! Fig::URL.is_url?(location()) end |
#standard_asset_name ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fig/statement/asset.rb', line 36 def standard_asset_name() # Not so hot of an idea if the location is a URL and has query parameters # in it, but not going to fix this now. basename = location().split('/').last if Fig::URL.is_url? location return CGI.unescape basename end return basename end |
#urls ⇒ Object
24 25 26 |
# File 'lib/fig/statement/asset.rb', line 24 def urls() return [location()] end |