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 (also: #x_tag)
-
#initialize(opts = {}) ⇒ Documentation
constructor
A new instance of Documentation.
- #resource(name, &block) ⇒ Object (also: #tag)
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
19 20 21 |
# File 'lib/dox/dsl/documentation.rb', line 19 def action(name, &block) self._action = Action.new(name, &block) end |
#config ⇒ Object
29 30 31 32 33 |
# File 'lib/dox/dsl/documentation.rb', line 29 def config {}.merge(_resource ? _resource.config : {}) .merge(_action ? _action.config : {}) .merge(_group ? _group.config : {}) end |
#group(name, &block) ⇒ Object Also known as: x_tag
23 24 25 |
# File 'lib/dox/dsl/documentation.rb', line 23 def group(name, &block) self._group = ResourceGroup.new(name, &block) end |
#resource(name, &block) ⇒ Object Also known as: tag
13 14 15 |
# File 'lib/dox/dsl/documentation.rb', line 13 def resource(name, &block) self._resource = Resource.new(name, &block) end |