Class: Adva::Static::Export::Path

Inherits:
String
  • Object
show all
Defined in:
lib/adva/static/export/path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hostObject (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

#extnameObject



19
20
21
# File 'lib/adva/static/export/path.rb', line 19

def extname
  @extname ||= File.extname(self)
end

#filenameObject



15
16
17
# File 'lib/adva/static/export/path.rb', line 15

def filename
  @filename ||= normalize_filename(self)
end

#html?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/adva/static/export/path.rb', line 23

def html?
  extname.blank? || extname == '.html'
end

#remote?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/adva/static/export/path.rb', line 27

def remote?
  host.present?
end