Class: Room

Inherits:
Sequel::Model
  • Object
show all
Defined in:
app/models/room.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.with_code!(kos_code) ⇒ Object

Return a room with a given kos_code or raise an error


7
8
9
# File 'app/models/room.rb', line 7

def self.with_code! kos_code
  first!(id: kos_code)
end

Instance Method Details

#kos_codeObject


15
16
17
# File 'app/models/room.rb', line 15

def kos_code
  id
end

#kos_code=(code) ⇒ Object


11
12
13
# File 'app/models/room.rb', line 11

def kos_code=(code)
  self.id = code
end

#to_sObject


19
20
21
# File 'app/models/room.rb', line 19

def to_s
  kos_code
end