Class: Droonga::CollectorMessage
- Inherits:
-
Object
- Object
- Droonga::CollectorMessage
- Defined in:
- lib/droonga/collector_message.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #body ⇒ Object
-
#initialize(raw) ⇒ CollectorMessage
constructor
A new instance of CollectorMessage.
- #input ⇒ Object
- #name ⇒ Object
- #outputs ⇒ Object
- #step ⇒ Object
- #task ⇒ Object
- #type ⇒ Object
- #valid? ⇒ Boolean
- #value ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(raw) ⇒ CollectorMessage
Returns a new instance of CollectorMessage.
19 20 21 |
# File 'lib/droonga/collector_message.rb', line 19 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
18 19 20 |
# File 'lib/droonga/collector_message.rb', line 18 def raw @raw end |
Instance Method Details
#[](key) ⇒ Object
27 28 29 |
# File 'lib/droonga/collector_message.rb', line 27 def [](key) @raw[key] end |
#body ⇒ Object
47 48 49 |
# File 'lib/droonga/collector_message.rb', line 47 def body step["body"] end |
#input ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/droonga/collector_message.rb', line 51 def input if body body[name] else nil end end |
#name ⇒ Object
63 64 65 |
# File 'lib/droonga/collector_message.rb', line 63 def name @raw["name"] end |
#outputs ⇒ Object
59 60 61 |
# File 'lib/droonga/collector_message.rb', line 59 def outputs step["outputs"] end |
#step ⇒ Object
35 36 37 |
# File 'lib/droonga/collector_message.rb', line 35 def step task["step"] end |
#task ⇒ Object
31 32 33 |
# File 'lib/droonga/collector_message.rb', line 31 def task @raw["task"] end |
#type ⇒ Object
39 40 41 |
# File 'lib/droonga/collector_message.rb', line 39 def type step["type"] end |
#valid? ⇒ Boolean
23 24 25 |
# File 'lib/droonga/collector_message.rb', line 23 def valid? task and step and values end |
#value ⇒ Object
67 68 69 |
# File 'lib/droonga/collector_message.rb', line 67 def value @raw["value"] end |
#values ⇒ Object
43 44 45 |
# File 'lib/droonga/collector_message.rb', line 43 def values task["values"] end |