Class: OSC::Reservations::Node
- Inherits:
-
Object
- Object
- OSC::Reservations::Node
- Defined in:
- lib/osc/reservations/node.rb
Overview
Provides a way for the developer to view the properties of any given reserved node.
Instance Attribute Summary collapse
-
#id ⇒ String
The ID of this node.
-
#jobs ⇒ Array<String>
A list of job id’s running on this node.
-
#np ⇒ Fixnum
Number of cores on this node.
-
#props ⇒ Array<String>
A list of properties for this node.
-
#users ⇒ Array<String>
A list of users running on this node.
Instance Method Summary collapse
-
#free? ⇒ Boolean
Is this node free to use?.
-
#initialize(opts) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(opts) ⇒ Node
Returns a new instance of Node.
27 28 29 30 31 32 33 |
# File 'lib/osc/reservations/node.rb', line 27 def initialize(opts) @id = opts[:id] @np = opts[:np] @props = opts[:props] @jobs = opts[:jobs] @users = opts[:users] end |
Instance Attribute Details
#id ⇒ String
Returns The ID of this node.
7 8 9 |
# File 'lib/osc/reservations/node.rb', line 7 def id @id end |
#jobs ⇒ Array<String>
Returns A list of job id’s running on this node.
16 17 18 |
# File 'lib/osc/reservations/node.rb', line 16 def jobs @jobs end |
#np ⇒ Fixnum
Returns Number of cores on this node.
10 11 12 |
# File 'lib/osc/reservations/node.rb', line 10 def np @np end |
#props ⇒ Array<String>
Returns A list of properties for this node.
13 14 15 |
# File 'lib/osc/reservations/node.rb', line 13 def props @props end |
#users ⇒ Array<String>
Returns A list of users running on this node.
19 20 21 |
# File 'lib/osc/reservations/node.rb', line 19 def users @users end |
Instance Method Details
#free? ⇒ Boolean
Is this node free to use?
37 38 39 |
# File 'lib/osc/reservations/node.rb', line 37 def free? jobs.empty? end |