Class: Droonga::CollectorMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/collector_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (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

#bodyObject



47
48
49
# File 'lib/droonga/collector_message.rb', line 47

def body
  step["body"]
end

#inputObject



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

#nameObject



63
64
65
# File 'lib/droonga/collector_message.rb', line 63

def name
  @raw["name"]
end

#outputsObject



59
60
61
# File 'lib/droonga/collector_message.rb', line 59

def outputs
  step["outputs"]
end

#stepObject



35
36
37
# File 'lib/droonga/collector_message.rb', line 35

def step
  task["step"]
end

#taskObject



31
32
33
# File 'lib/droonga/collector_message.rb', line 31

def task
  @raw["task"]
end

#typeObject



39
40
41
# File 'lib/droonga/collector_message.rb', line 39

def type
  step["type"]
end

#valid?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/droonga/collector_message.rb', line 23

def valid?
  task and step and values
end

#valueObject



67
68
69
# File 'lib/droonga/collector_message.rb', line 67

def value
  @raw["value"]
end

#valuesObject



43
44
45
# File 'lib/droonga/collector_message.rb', line 43

def values
  task["values"]
end