Class: LogList
- Inherits:
-
Object
- Object
- LogList
- Defined in:
- lib/rscalr/model/log_list.rb
Instance Attribute Summary collapse
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#logs ⇒ Object
readonly
Returns the value of attribute logs.
-
#start ⇒ Object
Returns the value of attribute start.
-
#total_records ⇒ Object
Returns the value of attribute total_records.
Instance Method Summary collapse
- #<<(log) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ LogList
constructor
A new instance of LogList.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ LogList
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
#limit ⇒ Object
Returns the value of attribute limit.
2 3 4 |
# File 'lib/rscalr/model/log_list.rb', line 2 def limit @limit end |
#logs ⇒ Object (readonly)
Returns the value of attribute logs.
3 4 5 |
# File 'lib/rscalr/model/log_list.rb', line 3 def logs @logs end |
#start ⇒ Object
Returns the value of attribute start.
2 3 4 |
# File 'lib/rscalr/model/log_list.rb', line 2 def start @start end |
#total_records ⇒ Object
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 |
#each ⇒ Object
13 14 15 16 17 |
# File 'lib/rscalr/model/log_list.rb', line 13 def each @logs.each { |log| yield log } end |
#to_s ⇒ Object
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 |