Class: Droonga::SingleStepDefinition
- Inherits:
-
Object
- Object
- Droonga::SingleStepDefinition
- Defined in:
- lib/droonga/single_step_definition.rb
Instance Attribute Summary collapse
-
#collector ⇒ Object
Returns the value of attribute collector.
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#inputs ⇒ Object
Returns the value of attribute inputs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output ⇒ Object
Returns the value of attribute output.
-
#single_operation ⇒ Object
writeonly
Sets the attribute single_operation.
-
#timeout_calculator ⇒ Object
writeonly
Sets the attribute timeout_calculator.
-
#use_all_replicas ⇒ Object
writeonly
Sets the attribute use_all_replicas.
-
#write ⇒ Object
writeonly
Sets the attribute write.
Instance Method Summary collapse
- #collector_class ⇒ Object
- #handler_class ⇒ Object
-
#initialize(plugin_module) {|_self| ... } ⇒ SingleStepDefinition
constructor
A new instance of SingleStepDefinition.
- #single_operation? ⇒ Boolean
- #timeout_for_step(step) ⇒ Object
- #use_all_replicas? ⇒ Boolean
- #write? ⇒ Boolean
Constructor Details
#initialize(plugin_module) {|_self| ... } ⇒ SingleStepDefinition
Returns a new instance of SingleStepDefinition.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/droonga/single_step_definition.rb', line 26 def initialize(plugin_module) @plugin_module = plugin_module @name = nil @handler = nil @collector = nil @write = false @single_operation = false @use_all_replicas = false @timeout_calculator = lambda do |step| if step["timeout"] return step["timeout"] elsif step["body"] return step["body"]["timeout"] if step["body"]["timeout"] end nil end @inputs = [] @output = {} yield(self) end |
Instance Attribute Details
#collector ⇒ Object
Returns the value of attribute collector.
20 21 22 |
# File 'lib/droonga/single_step_definition.rb', line 20 def collector @collector end |
#handler ⇒ Object
Returns the value of attribute handler.
19 20 21 |
# File 'lib/droonga/single_step_definition.rb', line 19 def handler @handler end |
#inputs ⇒ Object
Returns the value of attribute inputs.
24 25 26 |
# File 'lib/droonga/single_step_definition.rb', line 24 def inputs @inputs end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/droonga/single_step_definition.rb', line 18 def name @name end |
#output ⇒ Object
Returns the value of attribute output.
25 26 27 |
# File 'lib/droonga/single_step_definition.rb', line 25 def output @output end |
#single_operation=(value) ⇒ Object (writeonly)
Sets the attribute single_operation
21 22 23 |
# File 'lib/droonga/single_step_definition.rb', line 21 def single_operation=(value) @single_operation = value end |
#timeout_calculator=(value) ⇒ Object (writeonly)
Sets the attribute timeout_calculator
23 24 25 |
# File 'lib/droonga/single_step_definition.rb', line 23 def timeout_calculator=(value) @timeout_calculator = value end |
#use_all_replicas=(value) ⇒ Object (writeonly)
Sets the attribute use_all_replicas
22 23 24 |
# File 'lib/droonga/single_step_definition.rb', line 22 def use_all_replicas=(value) @use_all_replicas = value end |
#write=(value) ⇒ Object (writeonly)
Sets the attribute write
21 22 23 |
# File 'lib/droonga/single_step_definition.rb', line 21 def write=(value) @write = value end |
Instance Method Details
#collector_class ⇒ Object
74 75 76 |
# File 'lib/droonga/single_step_definition.rb', line 74 def collector_class resolve_class(@collector) end |
#handler_class ⇒ Object
70 71 72 |
# File 'lib/droonga/single_step_definition.rb', line 70 def handler_class resolve_class(@handler) end |
#single_operation? ⇒ Boolean
52 53 54 55 |
# File 'lib/droonga/single_step_definition.rb', line 52 def single_operation? return false if @write @single_operation end |
#timeout_for_step(step) ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/droonga/single_step_definition.rb', line 62 def timeout_for_step(step) if @timeout_calculator @timeout_calculator.call(step) else nil end end |
#use_all_replicas? ⇒ Boolean
57 58 59 60 |
# File 'lib/droonga/single_step_definition.rb', line 57 def use_all_replicas? return true if @write @use_all_replicas end |
#write? ⇒ Boolean
48 49 50 |
# File 'lib/droonga/single_step_definition.rb', line 48 def write? @write end |