Class: Dox::DSL::Documentation

Inherits:
Object
  • Object
show all
Defined in:
lib/dox/dsl/documentation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#_actionObject

Returns the value of attribute _action.



6
7
8
# File 'lib/dox/dsl/documentation.rb', line 6

def _action
  @_action
end

#_groupObject

Returns the value of attribute _group.



7
8
9
# File 'lib/dox/dsl/documentation.rb', line 7

def _group
  @_group
end

#_resourceObject

Returns the value of attribute _resource.



5
6
7
# File 'lib/dox/dsl/documentation.rb', line 5

def _resource
  @_resource
end

#subjectObject

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

#configObject



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