Class: IrcMachine::State

Inherits:
Object
  • Object
show all
Defined in:
lib/irc_machine/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeState

Returns a new instance of State.



7
8
9
# File 'lib/irc_machine/state.rb', line 7

def initialize
  reset
end

Instance Attribute Details

#channelsObject

Returns the value of attribute channels.



5
6
7
# File 'lib/irc_machine/state.rb', line 5

def channels
  @channels
end

#nickObject

Returns the value of attribute nick.



4
5
6
# File 'lib/irc_machine/state.rb', line 4

def nick
  @nick
end

Instance Method Details

#channel?(channel) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/irc_machine/state.rb', line 16

def channel?(channel)
  channels.include? channel
end

#resetObject



11
12
13
14
# File 'lib/irc_machine/state.rb', line 11

def reset
  @nick = nil
  @channels = []
end