Class: Wakame::Event::InstanceCountChanged

Inherits:
Base
  • Object
show all
Defined in:
lib/wakame/event.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#time

Instance Method Summary collapse

Methods inherited from Base

#log_message

Constructor Details

#initialize(resource, prev_count, count) ⇒ InstanceCountChanged

Returns a new instance of InstanceCountChanged.



215
216
217
218
219
# File 'lib/wakame/event.rb', line 215

def initialize(resource, prev_count, count)
  @resource = resource
  @prev_count = prev_count
  @count = count
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



214
215
216
# File 'lib/wakame/event.rb', line 214

def count
  @count
end

#prev_countObject (readonly)

Returns the value of attribute prev_count.



214
215
216
# File 'lib/wakame/event.rb', line 214

def prev_count
  @prev_count
end

#resourceObject (readonly)

Returns the value of attribute resource.



214
215
216
# File 'lib/wakame/event.rb', line 214

def resource
  @resource
end

Instance Method Details

#decreased?Boolean

Returns:

  • (Boolean)


225
226
227
# File 'lib/wakame/event.rb', line 225

def decreased?
  @prev_count > @count
end

#increased?Boolean

Returns:

  • (Boolean)


221
222
223
# File 'lib/wakame/event.rb', line 221

def increased?
  @prev_count < @count
end