Module: AssOle::DSL
- Included in:
- Module
- Defined in:
- lib/ass_ole/dsl.rb
Overview
It mixins for Module
Instance Method Summary collapse
-
#is_ole_runtime(type) ⇒ Object
Define Ole runtime.
-
#is_ole_snippet ⇒ Object
Define module as Ole snippet.
-
#it_has_ole_runtime(runtime) ⇒ Object
Define class or module wich include Ole runtime.
-
#like_ole_runtime(runtime) ⇒ Object
Define class or module which transparent call Ole runtime as self.
Instance Method Details
#is_ole_runtime(type) ⇒ Object
Define Ole runtime
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/ass_ole/dsl.rb', line 104 def is_ole_runtime(type) fail 'Ole runtime is a Module not a Class' if self.class == Class case type when :external then extend AssOle::Runtimes::App::External when :thick then extend AssOle::Runtimes::App::Thick when :thin then extend AssOle::Runtimes::App::Thin when :wp then extend AssOle::Runtimes::Claster::Wp when :agent then extend AssOle::Runtimes::Claster::Agent else fail "Invalid runtime #{type}" end end |
#is_ole_snippet ⇒ Object
Define module as Ole snippet
30 31 32 33 34 |
# File 'lib/ass_ole/dsl.rb', line 30 def is_ole_snippet fail 'Ole snippet must be a Module not a Class' if\ self.class == Class extend AssOle::Snippets::IsSnippet end |
#it_has_ole_runtime(runtime) ⇒ Object
Define class or module wich include Ole runtime
74 75 76 77 78 79 80 81 |
# File 'lib/ass_ole/dsl.rb', line 74 def it_has_ole_runtime(runtime) case self when Class then include runtime else extend runtime end end |
#like_ole_runtime(runtime) ⇒ Object
Define class or module which transparent call Ole runtime as self
50 51 52 53 54 55 56 57 58 |
# File 'lib/ass_ole/dsl.rb', line 50 def like_ole_runtime(runtime) it_has_ole_runtime runtime case self when Class then include AssOle::Snippets::LikeOleRuntime else extend AssOle::Snippets::LikeOleRuntime end end |