Class: ApiDoc::Runner
- Inherits:
-
Object
- Object
- ApiDoc::Runner
- Defined in:
- lib/apidoc.rb
Defined Under Namespace
Classes: Blueprint
Instance Attribute Summary collapse
-
#accept ⇒ Object
Returns the value of attribute accept.
-
#after_all_blocks ⇒ Object
Returns the value of attribute after_all_blocks.
-
#after_each_blocks ⇒ Object
Returns the value of attribute after_each_blocks.
-
#before_all_blocks ⇒ Object
Returns the value of attribute before_all_blocks.
-
#before_each_blocks ⇒ Object
Returns the value of attribute before_each_blocks.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#resources ⇒ Object
Returns the value of attribute resources.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(&block) ⇒ Runner
Returns a new instance of Runner.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/apidoc.rb', line 20 def initialize(&block) @resources = [] @accept = nil @content_type = nil @before_each_blocks = [] @before_all_blocks = [] @after_each_blocks = [] @after_all_blocks = [] Blueprint.new self, &block end |
Instance Attribute Details
#accept ⇒ Object
Returns the value of attribute accept.
31 32 33 |
# File 'lib/apidoc.rb', line 31 def accept @accept end |
#after_all_blocks ⇒ Object
Returns the value of attribute after_all_blocks.
31 32 33 |
# File 'lib/apidoc.rb', line 31 def after_all_blocks @after_all_blocks end |
#after_each_blocks ⇒ Object
Returns the value of attribute after_each_blocks.
31 32 33 |
# File 'lib/apidoc.rb', line 31 def after_each_blocks @after_each_blocks end |
#before_all_blocks ⇒ Object
Returns the value of attribute before_all_blocks.
31 32 33 |
# File 'lib/apidoc.rb', line 31 def before_all_blocks @before_all_blocks end |
#before_each_blocks ⇒ Object
Returns the value of attribute before_each_blocks.
31 32 33 |
# File 'lib/apidoc.rb', line 31 def before_each_blocks @before_each_blocks end |
#content_type ⇒ Object
Returns the value of attribute content_type.
31 32 33 |
# File 'lib/apidoc.rb', line 31 def content_type @content_type end |
#resources ⇒ Object
Returns the value of attribute resources.
31 32 33 |
# File 'lib/apidoc.rb', line 31 def resources @resources end |
Instance Method Details
#run ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/apidoc.rb', line 86 def run @before_all_blocks.each {|block| instance_eval &block } @resources.each do |resource| @before_each_blocks.each {|block| instance_eval &block } resource.run @after_each_blocks.each {|block| instance_eval &block } end @after_all_blocks.each {|block| instance_eval &block } end |