Class: Staticfy::Handlers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/staticfy/handlers/base.rb

Direct Known Subclasses

CSS, HTML, Raw

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ Base

Returns a new instance of Base.



24
25
26
# File 'lib/staticfy/handlers/base.rb', line 24

def initialize(page)
  @page = page
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object

redirect calls to page, if it responds to



41
42
43
44
45
46
47
# File 'lib/staticfy/handlers/base.rb', line 41

def method_missing(name, *args)
  if @page.respond_to?(name)
    @page.send(name, *args)
  else
    super
  end
end

Instance Method Details



32
33
34
# File 'lib/staticfy/handlers/base.rb', line 32

def fetch_links
  []
end

#local_bodyObject



36
37
38
# File 'lib/staticfy/handlers/base.rb', line 36

def local_body
  body
end

#local_uriObject



28
29
30
# File 'lib/staticfy/handlers/base.rb', line 28

def local_uri
  Handlers.local_uri(url)
end