Class: Sinbotra::Bot::DefaultMessageHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/sinbotra/bot/default_message_history.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(store = []) ⇒ DefaultMessageHistory

Returns a new instance of DefaultMessageHistory.



5
6
7
# File 'lib/sinbotra/bot/default_message_history.rb', line 5

def initialize(store=[])
  @store = store
end

Instance Attribute Details

#storeObject (readonly)

Returns the value of attribute store.



3
4
5
# File 'lib/sinbotra/bot/default_message_history.rb', line 3

def store
  @store
end

Instance Method Details

#add_message(msg) ⇒ Object



9
10
11
# File 'lib/sinbotra/bot/default_message_history.rb', line 9

def add_message(msg)
  @store << msg
end

#allObject



13
# File 'lib/sinbotra/bot/default_message_history.rb', line 13

def all() @store end