Module: Waylon::User::ClassMethods

Defined in:
lib/waylon/user.rb

Overview

Class-level methods to be added to User subclasses

Instance Method Summary collapse

Instance Method Details

#find_by_handle(_email) ⇒ Object

This should be overridden by subclasses to provide a mechanism for looking up Users

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/waylon/user.rb', line 17

def find_by_handle()
  raise NotImplementedError, "find_by_handle isn't implemented"
end

#from_mention(_mention_string) ⇒ Object

This should be overridden by subclasses to provide a mechanism for looking up Users based on mention strings

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/waylon/user.rb', line 22

def from_mention(_mention_string)
  raise NotImplementedError, "from_mention isn't implemented"
end

#senseClass

Provides a simple mechanism for referencing User subclass’s Sense

Returns:

  • (Class)

    A Sense subclass



28
29
30
# File 'lib/waylon/user.rb', line 28

def sense
  Sense
end

#whoamiObject

This should be overridden by subclasses to provide a mechanism for the bot to get its own User

Raises:

  • (NotImplementedError)


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

def whoami
  raise NotImplementedError, "whoami isn't implemented"
end