Class: Useless::Doc::UI::Godel
- Inherits:
-
Object
- Object
- Useless::Doc::UI::Godel
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
28
29
30
|
# File 'lib/useless/doc/ui/godel.rb', line 28
def initialize(router)
@router = router
end
|
Class Method Details
.asset_path ⇒ Object
16
17
18
|
# File 'lib/useless/doc/ui/godel.rb', line 16
def self.asset_path
File.dirname(__FILE__) + '/godel'
end
|
.markdown ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/useless/doc/ui/godel.rb', line 20
def self.markdown
@markdown ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML,
:no_intra_emphasis => true, :tables => true,
:fenced_code_blocks => true,:autolink => true,
:space_after_headers => true, :lax_spacing => true,
:superscript => true)
end
|
Instance Method Details
#css(entity = nil) ⇒ Object
44
45
46
|
# File 'lib/useless/doc/ui/godel.rb', line 44
def css(entity = nil)
File.read(Godel.asset_path + '/stylesheet.css')
end
|
#html(entity) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/useless/doc/ui/godel.rb', line 32
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
|