Class: Restapi::Configuration
- Inherits:
-
Object
- Object
- Restapi::Configuration
- Defined in:
- lib/restapi/restapi_module.rb
Instance Attribute Summary collapse
-
#api_base_url ⇒ Object
Returns the value of attribute api_base_url.
-
#api_controllers_matcher ⇒ Object
matcher to be used in Dir.glob to find controllers to be reloaded e.g.
-
#app_info ⇒ Object
Returns the value of attribute app_info.
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#copyright ⇒ Object
Returns the value of attribute copyright.
-
#doc_base_url ⇒ Object
Returns the value of attribute doc_base_url.
-
#markup ⇒ Object
Returns the value of attribute markup.
-
#reload_controllers ⇒ Object
writeonly
set to true if you want to reload the controllers at each refresh of the documentation.
-
#validate ⇒ Object
Returns the value of attribute validate.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reload_controllers? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
51 52 53 54 55 56 57 58 59 |
# File 'lib/restapi/restapi_module.rb', line 51 def initialize @markup = Restapi::Markup::RDoc.new @app_name = "Another API" @app_info = "Another API description" @copyright = nil @validate = true @api_base_url = "" @doc_base_url = "/restapi" end |
Instance Attribute Details
#api_base_url ⇒ Object
Returns the value of attribute api_base_url.
29 30 31 |
# File 'lib/restapi/restapi_module.rb', line 29 def api_base_url @api_base_url end |
#api_controllers_matcher ⇒ Object
matcher to be used in Dir.glob to find controllers to be reloaded e.g.
"#{Rails.root}/app/controllers/api/*.rb"
35 36 37 |
# File 'lib/restapi/restapi_module.rb', line 35 def api_controllers_matcher @api_controllers_matcher end |
#app_info ⇒ Object
Returns the value of attribute app_info.
29 30 31 |
# File 'lib/restapi/restapi_module.rb', line 29 def app_info @app_info end |
#app_name ⇒ Object
Returns the value of attribute app_name.
29 30 31 |
# File 'lib/restapi/restapi_module.rb', line 29 def app_name @app_name end |
#copyright ⇒ Object
Returns the value of attribute copyright.
29 30 31 |
# File 'lib/restapi/restapi_module.rb', line 29 def copyright @copyright end |
#doc_base_url ⇒ Object
Returns the value of attribute doc_base_url.
29 30 31 |
# File 'lib/restapi/restapi_module.rb', line 29 def doc_base_url @doc_base_url end |
#markup ⇒ Object
Returns the value of attribute markup.
29 30 31 |
# File 'lib/restapi/restapi_module.rb', line 29 def markup @markup end |
#reload_controllers=(value) ⇒ Object (writeonly)
set to true if you want to reload the controllers at each refresh of the documentation. It requires :api_controllers_matcher
to be set to work properly.
40 41 42 |
# File 'lib/restapi/restapi_module.rb', line 40 def reload_controllers=(value) @reload_controllers = value end |
#validate ⇒ Object
Returns the value of attribute validate.
29 30 31 |
# File 'lib/restapi/restapi_module.rb', line 29 def validate @validate end |
Instance Method Details
#reload_controllers? ⇒ Boolean
42 43 44 45 |
# File 'lib/restapi/restapi_module.rb', line 42 def reload_controllers? @reload_controllers = Rails.env.development? unless defined? @reload_controllers return @reload_controllers && @api_controllers_matcher end |