Class: Betterdocs::Dsl::Controller::Controller
Instance Method Summary
collapse
inherited, #initialize
#set_context
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Betterdocs::Dsl::Common
Instance Method Details
#add_to_collector(collector) ⇒ Object
28
29
30
|
# File 'lib/betterdocs/dsl/controller/controller.rb', line 28
def add_to_collector(collector)
collector.controller = self
end
|
#name ⇒ Object
4
5
6
|
# File 'lib/betterdocs/dsl/controller/controller.rb', line 4
def name
@name ||= controller.to_s.underscore.sub(/_controller\z/, '').to_sym
end
|
#to_s ⇒ Object
24
25
26
|
# File 'lib/betterdocs/dsl/controller/controller.rb', line 24
def to_s
[ controller, '', "url: #{url}", '', description, '' ] * "\n"
end
|
#url ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/betterdocs/dsl/controller/controller.rb', line 12
def url
Betterdocs::Global.url_for(
controller: name,
action: :index,
format: 'json'
)
end
|