Class: Code

Inherits:
Object show all
Defined in:
lib/models/code.rb

Class Method Summary collapse

Class Method Details

.get_codes(code_group_name) ⇒ Object

Returns all the codes that belong to the given code group name



6
7
8
# File 'lib/models/code.rb', line 6

def Code.get_codes(code_group_name)
  filter(:name=>code_group_name).collect(&:description)
end

.valid_value_for_group?(value, code_group_name) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/models/code.rb', line 10

def Code.valid_value_for_group?(value, code_group_name)
  filter(:name=>CodeGroup.send(code_group_name)).find{|type| type.value == value}
end