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.
8 9 10 11 12 13 |
# File 'lib/jerakia/dsl/lookup.rb', line 8 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.
6 7 8 |
# File 'lib/jerakia/dsl/lookup.rb', line 6 def lookup @lookup end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
4 5 6 |
# File 'lib/jerakia/dsl/lookup.rb', line 4 def policy @policy end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/jerakia/dsl/lookup.rb', line 5 def request @request end |
Class Method Details
.evaluate(name, policy, opts, &block) ⇒ Object
15 16 17 18 19 |
# File 'lib/jerakia/dsl/lookup.rb', line 15 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
36 37 38 |
# File 'lib/jerakia/dsl/lookup.rb', line 36 def confine(*args) lookup.confine(*args) end |
#continue ⇒ Object
52 53 54 |
# File 'lib/jerakia/dsl/lookup.rb', line 52 def continue lookup.continue end |
#datasource(name, opts = {}) ⇒ Object
define the data source for the lookup @api: public
23 24 25 26 |
# File 'lib/jerakia/dsl/lookup.rb', line 23 def datasource(name, opts = {}) datasource = Jerakia::Datasource.new(name, lookup, opts) lookup.datasource = datasource end |
#exclude(*args) ⇒ Object
40 41 42 |
# File 'lib/jerakia/dsl/lookup.rb', line 40 def exclude(*args) lookup.exclude(*args) end |
#invalidate ⇒ Object
44 45 46 |
# File 'lib/jerakia/dsl/lookup.rb', line 44 def invalidate lookup.invalidate end |
#output_filter(*args) ⇒ Object
56 57 58 |
# File 'lib/jerakia/dsl/lookup.rb', line 56 def output_filter(*args) lookup.output_filter(*args) end |
#plugin ⇒ Object
60 61 62 |
# File 'lib/jerakia/dsl/lookup.rb', line 60 def plugin lookup.plugin end |
#scope ⇒ Object
give access to the lookup scope object @api: public
30 31 32 |
# File 'lib/jerakia/dsl/lookup.rb', line 30 def scope lookup.scope end |
#stop ⇒ Object
48 49 50 |
# File 'lib/jerakia/dsl/lookup.rb', line 48 def stop lookup.stop end |