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.



198
199
200
201
202
# File 'lib/wakame/event.rb', line 198

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.



197
198
199
# File 'lib/wakame/event.rb', line 197

def count
  @count
end

#prev_countObject (readonly)

Returns the value of attribute prev_count.



197
198
199
# File 'lib/wakame/event.rb', line 197

def prev_count
  @prev_count
end

#resourceObject (readonly)

Returns the value of attribute resource.



197
198
199
# File 'lib/wakame/event.rb', line 197

def resource
  @resource
end

Instance Method Details

#decreased?Boolean

Returns:

  • (Boolean)


208
209
210
# File 'lib/wakame/event.rb', line 208

def decreased?
  @prev_count > @count
end

#increased?Boolean

Returns:

  • (Boolean)


204
205
206
# File 'lib/wakame/event.rb', line 204

def increased?
  @prev_count < @count
end