Class: Proctor::Nodes

Inherits:
Object
  • Object
show all
Defined in:
lib/proctor/nodes.rb

Instance Method Summary collapse

Constructor Details

#initialize(app_files, params) ⇒ Nodes

Returns a new instance of Nodes.



6
7
8
9
10
# File 'lib/proctor/nodes.rb', line 6

def initialize(app_files, params)
  @app_files = app_files
  @params    = params
  @all       = node_list(app_files).map {|m| Node.new(*m)}
end

Instance Method Details

#allObject



12
13
14
# File 'lib/proctor/nodes.rb', line 12

def all
  @all.sort {|a,b| a.name <=> b.name}
end

#find_by_handle(handle) ⇒ Object



20
21
# File 'lib/proctor/nodes.rb', line 20

def find_by_handle(handle)
end

#find_by_name(name) ⇒ Object



16
17
18
# File 'lib/proctor/nodes.rb', line 16

def find_by_name(name)
  @all.find {|node| node.name == name}
end

#namesObject



23
24
25
# File 'lib/proctor/nodes.rb', line 23

def names
  @all.map {|node| node.name}.sort
end