Class: Dao::Api::DSL
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- Dao::Api::DSL
- Defined in:
- lib/dao/api/dsl.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
- #evaluate(&block) ⇒ Object
-
#initialize(api) ⇒ DSL
constructor
A new instance of DSL.
- #no_docs_left_on_stack! ⇒ Object
Constructor Details
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
4 5 6 |
# File 'lib/dao/api/dsl.rb', line 4 def api @api end |
Instance Method Details
#evaluate(&block) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/dao/api/dsl.rb', line 11 def evaluate(&block) #@evaluate.call(&block) @api.module_eval(&block) ensure #no_docs_left_on_stack! end |
#no_docs_left_on_stack! ⇒ Object
18 19 20 |
# File 'lib/dao/api/dsl.rb', line 18 def no_docs_left_on_stack! raise "no interface for #{ docs.inspect }" unless docs.empty? end |