Class: Useless::Doc::UI::Godel

Inherits:
Object
  • Object
show all
Includes:
Useless::Doc::UI
Defined in:
lib/useless/doc/ui/godel.rb

Defined Under Namespace

Classes: API, Domain, Request, Resource, Response

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(router) ⇒ Godel

Returns a new instance of Godel.



19
20
21
# File 'lib/useless/doc/ui/godel.rb', line 19

def initialize(router)
  @router = router
end

Class Method Details

.asset_pathObject



15
16
17
# File 'lib/useless/doc/ui/godel.rb', line 15

def self.asset_path
  File.dirname(__FILE__) + '/godel'
end

Instance Method Details

#css(entity = nil) ⇒ Object



35
36
37
# File 'lib/useless/doc/ui/godel.rb', line 35

def css(entity = nil)
  File.read(Godel.asset_path + '/stylesheet.css')
end

#html(entity) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/useless/doc/ui/godel.rb', line 23

def html(entity)
  view = case entity
  when Core::Domain   then Godel::Domain
  when Core::API      then Godel::API
  when Core::Resource then Godel::Resource
  end

  if view
    view.new(entity, @router).render
  end
end