Class: SendmailLog

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/in_sendmail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time, from_line, nrcpts = nil) ⇒ SendmailLog

Returns a new instance of SendmailLog.



148
149
150
151
152
153
154
155
156
# File 'lib/fluent/plugin/in_sendmail.rb', line 148

def initialize(time, from_line, nrcpts=nil)
  @time = time
  @from_line = from_line
  if nrcpts == nil
    @nrcpts = from_line["nrcpts"].to_i
  else
    @nrcpts = nrcpts
  end
end

Instance Attribute Details

#from_lineObject (readonly)

Returns the value of attribute from_line.



145
146
147
# File 'lib/fluent/plugin/in_sendmail.rb', line 145

def from_line
  @from_line
end

#nrcptsObject

Returns the value of attribute nrcpts.



146
147
148
# File 'lib/fluent/plugin/in_sendmail.rb', line 146

def nrcpts
  @nrcpts
end

#timeObject (readonly)

Returns the value of attribute time.



144
145
146
# File 'lib/fluent/plugin/in_sendmail.rb', line 144

def time
  @time
end

Instance Method Details

#to_jsonObject



158
159
160
161
162
163
164
# File 'lib/fluent/plugin/in_sendmail.rb', line 158

def to_json()
  return {
    "time" => @time,
    "from_line" => @from_line,
    "nrcpts" => @nrcpts,
  }
end