Class: Jerakia::Dsl::Lookup
- Inherits:
-
Object
- Object
- Jerakia::Dsl::Lookup
- Defined in:
- lib/jerakia/dsl/lookup.rb
Instance Attribute Summary collapse
-
#lookup ⇒ Object
Returns the value of attribute lookup.
-
#policy ⇒ Object
readonly
Returns the value of attribute policy.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Class Method Summary collapse
Instance Method Summary collapse
-
#confine(*args) ⇒ Object
pass through exposed functions from the main lookup object @api: public.
- #continue ⇒ Object
-
#datasource(name, opts = {}) ⇒ Object
define the data source for the lookup @api: public.
- #exclude(*args) ⇒ Object
-
#initialize(name, policy, opts = {}) ⇒ Lookup
constructor
A new instance of Lookup.
- #invalidate ⇒ Object
- #output_filter(*args) ⇒ Object
- #plugin ⇒ Object
-
#scope ⇒ Object
give access to the lookup scope object @api: public.
- #stop ⇒ Object
Constructor Details
#initialize(name, policy, opts = {}) ⇒ Lookup
Returns a new instance of Lookup.
9 10 11 12 13 14 |
# File 'lib/jerakia/dsl/lookup.rb', line 9 def initialize(name, policy, opts={}) @policy = policy @request = policy.clone_request scope = policy.scope @lookup = Jerakia::Lookup.new(name, opts, @request, scope) end |
Instance Attribute Details
#lookup ⇒ Object
Returns the value of attribute lookup.
7 8 9 |
# File 'lib/jerakia/dsl/lookup.rb', line 7 def lookup @lookup end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
5 6 7 |
# File 'lib/jerakia/dsl/lookup.rb', line 5 def policy @policy end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/jerakia/dsl/lookup.rb', line 6 def request @request end |
Class Method Details
.evaluate(name, policy, opts, &block) ⇒ Object
16 17 18 19 20 |
# File 'lib/jerakia/dsl/lookup.rb', line 16 def self.evaluate(name, policy, opts, &block) lookup_block = new(name, policy, opts) lookup_block.instance_eval &block policy.submit_lookup(lookup_block.lookup) end |
Instance Method Details
#confine(*args) ⇒ Object
pass through exposed functions from the main lookup object @api: public
37 38 39 |
# File 'lib/jerakia/dsl/lookup.rb', line 37 def confine(*args) lookup.confine(*args) end |
#continue ⇒ Object
53 54 55 |
# File 'lib/jerakia/dsl/lookup.rb', line 53 def continue lookup.continue end |
#datasource(name, opts = {}) ⇒ Object
define the data source for the lookup @api: public
24 25 26 27 |
# File 'lib/jerakia/dsl/lookup.rb', line 24 def datasource(name, opts={}) datasource = Jerakia::Datasource.new(name, lookup, opts) lookup.datasource=(datasource) end |
#exclude(*args) ⇒ Object
41 42 43 |
# File 'lib/jerakia/dsl/lookup.rb', line 41 def exclude(*args) lookup.exclude(*args) end |
#invalidate ⇒ Object
45 46 47 |
# File 'lib/jerakia/dsl/lookup.rb', line 45 def invalidate lookup.invalidate end |
#output_filter(*args) ⇒ Object
57 58 59 |
# File 'lib/jerakia/dsl/lookup.rb', line 57 def output_filter(*args) lookup.output_filter(*args) end |
#plugin ⇒ Object
61 62 63 |
# File 'lib/jerakia/dsl/lookup.rb', line 61 def plugin lookup.plugin end |
#scope ⇒ Object
give access to the lookup scope object @api: public
31 32 33 |
# File 'lib/jerakia/dsl/lookup.rb', line 31 def scope lookup.scope end |
#stop ⇒ Object
49 50 51 |
# File 'lib/jerakia/dsl/lookup.rb', line 49 def stop lookup.stop end |