Class: LogList

Inherits:
Object
  • Object
show all
Defined in:
lib/rscalr/model/log_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLogList

Returns a new instance of LogList.



5
6
7
# File 'lib/rscalr/model/log_list.rb', line 5

def initialize
  @logs = []
end

Instance Attribute Details

#limitObject

Returns the value of attribute limit.



2
3
4
# File 'lib/rscalr/model/log_list.rb', line 2

def limit
  @limit
end

#logsObject (readonly)

Returns the value of attribute logs.



3
4
5
# File 'lib/rscalr/model/log_list.rb', line 3

def logs
  @logs
end

#startObject

Returns the value of attribute start.



2
3
4
# File 'lib/rscalr/model/log_list.rb', line 2

def start
  @start
end

#total_recordsObject

Returns the value of attribute total_records.



2
3
4
# File 'lib/rscalr/model/log_list.rb', line 2

def total_records
  @total_records
end

Instance Method Details

#<<(log) ⇒ Object



9
10
11
# File 'lib/rscalr/model/log_list.rb', line 9

def <<(log)
  @logs << log if log.is_a? Log
end

#eachObject



13
14
15
16
17
# File 'lib/rscalr/model/log_list.rb', line 13

def each 
  @logs.each { |log|
    yield log  
  }
end

#to_sObject



19
20
21
# File 'lib/rscalr/model/log_list.rb', line 19

def to_s
  "{ type: \"loglist\", total_records: #{@total_records}, start: \"#{@message}\", limit: #{@severity}, logs: [ #{@logs.each do |log| log.to_s + ',' end} ] }"
end