Class: Dox::DSL::Documentation
- Inherits:
-
Object
- Object
- Dox::DSL::Documentation
- Defined in:
- lib/dox/dsl/documentation.rb
Instance Attribute Summary collapse
-
#_action ⇒ Object
Returns the value of attribute _action.
-
#_group ⇒ Object
Returns the value of attribute _group.
-
#_resource ⇒ Object
Returns the value of attribute _resource.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
- #action(name, &block) ⇒ Object
- #config ⇒ Object
- #group(name, &block) ⇒ Object
-
#initialize(opts = {}) ⇒ Documentation
constructor
A new instance of Documentation.
- #resource(name, &block) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Documentation
Returns a new instance of Documentation.
9 10 11 |
# File 'lib/dox/dsl/documentation.rb', line 9 def initialize(opts = {}) self.subject = opts.fetch :subject end |
Instance Attribute Details
#_action ⇒ Object
Returns the value of attribute _action.
6 7 8 |
# File 'lib/dox/dsl/documentation.rb', line 6 def _action @_action end |
#_group ⇒ Object
Returns the value of attribute _group.
7 8 9 |
# File 'lib/dox/dsl/documentation.rb', line 7 def _group @_group end |
#_resource ⇒ Object
Returns the value of attribute _resource.
5 6 7 |
# File 'lib/dox/dsl/documentation.rb', line 5 def _resource @_resource end |
#subject ⇒ Object
Returns the value of attribute subject.
4 5 6 |
# File 'lib/dox/dsl/documentation.rb', line 4 def subject @subject end |
Instance Method Details
#action(name, &block) ⇒ Object
17 18 19 |
# File 'lib/dox/dsl/documentation.rb', line 17 def action(name, &block) self._action = Action.new(name, &block) end |
#config ⇒ Object
25 26 27 28 29 |
# File 'lib/dox/dsl/documentation.rb', line 25 def config {}.merge(_resource ? _resource.config : {}) .merge(_action ? _action.config : {}) .merge(_group ? _group.config : {}) end |
#group(name, &block) ⇒ Object
21 22 23 |
# File 'lib/dox/dsl/documentation.rb', line 21 def group(name, &block) self._group = ResourceGroup.new(name, &block) end |