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



17
18
19
# File 'lib/dox/dsl/documentation.rb', line 17

def action(name, &block)
  self._action = Action.new(name, &block)
end

#configObject



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

#resource(name, &block) ⇒ Object



13
14
15
# File 'lib/dox/dsl/documentation.rb', line 13

def resource(name, &block)
  self._resource = Resource.new(name, &block)
end