Class: Butler::Remote::User

Inherits:
Object
  • Object
show all
Defined in:
lib/butler/remote/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, access) ⇒ User

Returns a new instance of User.



19
20
21
22
23
# File 'lib/butler/remote/user.rb', line 19

def initialize(name, access)
	@access	= access
	@session = Session.new
	@name 	= name.dup.freeze
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object



41
42
43
# File 'lib/butler/remote/user.rb', line 41

def method_missing(*args, &block)
	return nil
end

Instance Attribute Details

#accessObject (readonly)

Returns the value of attribute access.



12
13
14
# File 'lib/butler/remote/user.rb', line 12

def access
  @access
end

#sessionObject (readonly)

Returns the value of attribute session.



13
14
15
# File 'lib/butler/remote/user.rb', line 13

def session
  @session
end

Instance Method Details

#authorized?(*args) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/butler/remote/user.rb', line 15

def authorized?(*args)
	@access.authorized?(*args)
end

#channelsObject



33
34
35
# File 'lib/butler/remote/user.rb', line 33

def channels
	[]
end

#historyObject



37
38
39
# File 'lib/butler/remote/user.rb', line 37

def history
	[]
end

#nickObject



25
26
27
# File 'lib/butler/remote/user.rb', line 25

def nick
	@name
end

#statusObject



29
30
31
# File 'lib/butler/remote/user.rb', line 29

def status
	:online
end