Class: Baykit::BayServer::Common::Groups

Inherits:
Object
  • Object
show all
Includes:
Bcf
Defined in:
lib/baykit/bayserver/common/groups.rb

Defined Under Namespace

Classes: Group, Member

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGroups



61
62
63
64
# File 'lib/baykit/bayserver/common/groups.rb', line 61

def initialize
  @all_groups = {}
  @all_members = {}
end

Instance Attribute Details

#all_groupsObject (readonly)

Returns the value of attribute all_groups.



58
59
60
# File 'lib/baykit/bayserver/common/groups.rb', line 58

def all_groups
  @all_groups
end

#all_membersObject (readonly)

Returns the value of attribute all_members.



59
60
61
# File 'lib/baykit/bayserver/common/groups.rb', line 59

def all_members
  @all_members
end

Instance Method Details

#get_group(name) ⇒ Object



82
83
84
# File 'lib/baykit/bayserver/common/groups.rb', line 82

def get_group(name)
  return @all_groups[name]
end

#init(bcf) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/baykit/bayserver/common/groups.rb', line 66

def init(bcf)
  p = BcfParser.new
  doc = p.parse(bcf)

  doc.content_list.each do |obj|
    if obj.instance_of? BcfElement
      if obj.name.casecmp?("group")
        init_groups(obj)
      elsif obj.name.casecmp?("member")
        init_members(obj)
      end
    end
  end
end