Class: Proctor::Managers
- Inherits:
-
Object
- Object
- Proctor::Managers
- Defined in:
- lib/proctor/managers.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
-
#app_files ⇒ Object
readonly
Returns the value of attribute app_files.
Instance Method Summary collapse
- #find_by_handle(handle) ⇒ Object
- #find_by_name(name) ⇒ Object
-
#initialize(app_files, params) ⇒ Managers
constructor
A new instance of Managers.
- #names ⇒ Object
Constructor Details
#initialize(app_files, params) ⇒ Managers
Returns a new instance of Managers.
8 9 10 11 12 13 14 |
# File 'lib/proctor/managers.rb', line 8 def initialize(app_files, params) @app_files = app_files @params = params @all = manager_list(app_files).map do |m| Manager.new(*m) end.sort {|a,b| a.name <=> b.name} end |
Instance Attribute Details
#all ⇒ Object (readonly)
Returns the value of attribute all.
6 7 8 |
# File 'lib/proctor/managers.rb', line 6 def all @all end |
#app_files ⇒ Object (readonly)
Returns the value of attribute app_files.
6 7 8 |
# File 'lib/proctor/managers.rb', line 6 def app_files @app_files end |
Instance Method Details
#find_by_handle(handle) ⇒ Object
24 25 |
# File 'lib/proctor/managers.rb', line 24 def find_by_handle(handle) end |
#find_by_name(name) ⇒ Object
20 21 22 |
# File 'lib/proctor/managers.rb', line 20 def find_by_name(name) @all.find {|manager| manager.name == name} end |
#names ⇒ Object
16 17 18 |
# File 'lib/proctor/managers.rb', line 16 def names @all.map {|m| m.name}.sort end |