Class: Participle::Prompt

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/storage.rb

Overview

Prompt storage.

Class Method Summary (collapse)

Class Method Details

+ (Array<Prompt>) by_room(room)

Get a list of prompts by room.

Parameters:

  • room (String)

    the room to search in

Returns:



93
94
95
# File 'lib/storage.rb', line 93

def self.by_room(room)
  Room.find_by_name(room).prompts || []
end

+ (Array<Prompt>) by_user(name)

Get a list of prompts by user.

Parameters:

  • name (String)

    the user to fetch prompts for

Returns:



86
87
88
# File 'lib/storage.rb', line 86

def self.by_user(name)
  Prompt.where :user_name => name
end