Class: Shared::Group
Direct Known Subclasses
Instance Attribute Summary collapse
-
#installations ⇒ Object
readonly
The group’s installations.
-
#name ⇒ Object
readonly
The name of the group.
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(location, client, nodes_class, installations_class) ⇒ Group
constructor
:nodoc:#.
-
#nodes ⇒ Object
An array of the group’s nodes.
-
#to_s ⇒ Object
:nodoc:.
Constructor Details
#initialize(location, client, nodes_class, installations_class) ⇒ Group
:nodoc:#
43 44 45 46 47 48 |
# File 'lib/vas/shared/groups.rb', line 43 def initialize(location, client, nodes_class, installations_class) #:nodoc:# super(location, client) @name = details["name"] @installations = installations_class.new(Util::LinkUtils.get_link_href(details, "installations"), client) @nodes_class = nodes_class end |
Instance Attribute Details
#installations ⇒ Object (readonly)
The group’s installations
38 39 40 |
# File 'lib/vas/shared/groups.rb', line 38 def installations @installations end |
#name ⇒ Object (readonly)
The name of the group
41 42 43 |
# File 'lib/vas/shared/groups.rb', line 41 def name @name end |
Instance Method Details
#nodes ⇒ Object
An array of the group’s nodes
51 52 53 54 55 |
# File 'lib/vas/shared/groups.rb', line 51 def nodes nodes = [] Util::LinkUtils.get_link_hrefs(client.get(location), "node").each { |node_location| nodes << @nodes_class.new(node_location, client)} nodes end |
#to_s ⇒ Object
:nodoc:
57 58 59 |
# File 'lib/vas/shared/groups.rb', line 57 def to_s #:nodoc: "#<#{self.class} name='#@name'>" end |