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

Returns the current value of active.

Returns:

  • (Array)

    the current value of active



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

def active
  @active
end

#busyArray

Returns the current value of busy.

Returns:

  • (Array)

    the current value of busy



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

def busy
  @busy
end

#failureArray

Returns the current value of failure.

Returns:

  • (Array)

    the current value of failure



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

def failure
  @failure
end

#inactiveArray

Returns the current value of inactive.

Returns:

  • (Array)

    the current value of inactive



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| Node.build(n) },
    active:   attrs[:active].map { |n| Node.build(n) },
    busy:     attrs[:busy].map { |n| Node.build(n) },
    failure:  attrs[:failure].map { |n| Node.build(n) }
  )
end