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.



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

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.



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

def from_line
  @from_line
end

#nrcptsObject

Returns the value of attribute nrcpts.



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

def nrcpts
  @nrcpts
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

Instance Method Details

#to_jsonObject



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

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