Class: Nis::Struct::NodeCollection

Inherits:
Object
  • Object
show all
Includes:
Util::Assignable
Defined in:
lib/nis/struct/node_collection.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Util::Assignable

#[], #initialize, #to_hash, #to_json

Instance Attribute Details

#activeArray


7
8
9
# File 'lib/nis/struct/node_collection.rb', line 7

def active
  @active
end

#busyArray


7
8
9
# File 'lib/nis/struct/node_collection.rb', line 7

def busy
  @busy
end

#failureArray


7
8
9
# File 'lib/nis/struct/node_collection.rb', line 7

def failure
  @failure
end

#inactiveArray


7
8
9
# File 'lib/nis/struct/node_collection.rb', line 7

def inactive
  @inactive
end

Class Method Details

.build(attrs) ⇒ Object


11
12
13
14
15
16
17
18
# File 'lib/nis/struct/node_collection.rb', line 11

def self.build(attrs)
  new(
    inactive: attrs[:inactive].map { |n| NodeInfo.build(n) },
    active:   attrs[:active].map { |n| NodeInfo.build(n) },
    busy:     attrs[:busy].map { |n| NodeInfo.build(n) },
    failure:  attrs[:failure].map { |n| NodeInfo.build(n) }
  )
end