Class: Adva::Static::Export::Path
- Inherits:
-
String
- Object
- String
- Adva::Static::Export::Path
- Defined in:
- lib/adva/static/export/path.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
- #extname ⇒ Object
- #filename ⇒ Object
- #html? ⇒ Boolean
-
#initialize(path) ⇒ Path
constructor
A new instance of Path.
- #remote? ⇒ Boolean
Constructor Details
#initialize(path) ⇒ Path
Returns a new instance of Path.
9 10 11 12 13 |
# File 'lib/adva/static/export/path.rb', line 9 def initialize(path) @host = URI.parse(path.to_s).host rescue 'invalid.host' path = normalize_path(path) super end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
7 8 9 |
# File 'lib/adva/static/export/path.rb', line 7 def host @host end |
Instance Method Details
#extname ⇒ Object
19 20 21 |
# File 'lib/adva/static/export/path.rb', line 19 def extname @extname ||= File.extname(self) end |
#filename ⇒ Object
15 16 17 |
# File 'lib/adva/static/export/path.rb', line 15 def filename @filename ||= normalize_filename(self) end |
#html? ⇒ Boolean
23 24 25 |
# File 'lib/adva/static/export/path.rb', line 23 def html? extname.blank? || extname == '.html' end |
#remote? ⇒ Boolean
27 28 29 |
# File 'lib/adva/static/export/path.rb', line 27 def remote? host.present? end |