Class: Jerakia::Dsl::Lookup

Inherits:
Object
  • Object
show all
Defined in:
lib/jerakia/dsl/lookup.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, request, scope, opts = {}) ⇒ Lookup

Returns a new instance of Lookup


8
9
10
11
12
# File 'lib/jerakia/dsl/lookup.rb', line 8

def initialize(name, request, scope, opts = {})
  @request = request
  @scope_object = scope
  @lookup = Jerakia::Lookup.new(name, opts, request, scope)
end

Instance Attribute Details

#lookupObject

Returns the value of attribute lookup


6
7
8
# File 'lib/jerakia/dsl/lookup.rb', line 6

def lookup
  @lookup
end

#requestObject (readonly)

Returns the value of attribute request


4
5
6
# File 'lib/jerakia/dsl/lookup.rb', line 4

def request
  @request
end

#scope_objectObject (readonly)

Returns the value of attribute scope_object


5
6
7
# File 'lib/jerakia/dsl/lookup.rb', line 5

def scope_object
  @scope_object
end

Class Method Details

.evaluate(name, request, scope, opts, &block) ⇒ Object


14
15
16
17
18
# File 'lib/jerakia/dsl/lookup.rb', line 14

def self.evaluate(name, request, scope, opts, &block)
  lookup_block = new(name, request, scope, opts)
  lookup_block.instance_eval &block
  return lookup_block.lookup
end

Instance Method Details

#confine(*args) ⇒ Object

pass through exposed functions from the main lookup object @api: public


28
29
30
# File 'lib/jerakia/dsl/lookup.rb', line 28

def confine(*args)
  lookup.confine(*args)
end

#continueObject


48
49
50
# File 'lib/jerakia/dsl/lookup.rb', line 48

def continue
  lookup.continue
end

#datasource(name, opts = {}) ⇒ Object

define the data source for the lookup @api: public


22
23
24
# File 'lib/jerakia/dsl/lookup.rb', line 22

def datasource(name, opts = {})
  lookup.datasource = { :name => name, :opts => opts }
end

#exclude(*args) ⇒ Object


36
37
38
# File 'lib/jerakia/dsl/lookup.rb', line 36

def exclude(*args)
  lookup.exclude(*args)
end

#invalidateObject


40
41
42
# File 'lib/jerakia/dsl/lookup.rb', line 40

def invalidate
  lookup.invalidate
end

#output_filter(*args) ⇒ Object


52
53
54
# File 'lib/jerakia/dsl/lookup.rb', line 52

def output_filter(*args)
  lookup.output_filter(*args)
end

#pluginObject


56
57
58
# File 'lib/jerakia/dsl/lookup.rb', line 56

def plugin
  lookup.plugin
end

#scopeObject


32
33
34
# File 'lib/jerakia/dsl/lookup.rb', line 32

def scope
  @scope_object.value
end

#stopObject


44
45
46
# File 'lib/jerakia/dsl/lookup.rb', line 44

def stop
  lookup.stop
end