Class: Baykit::BayServer::Common::Groups
- Inherits:
-
Object
- Object
- Baykit::BayServer::Common::Groups
- Includes:
- Bcf
- Defined in:
- lib/baykit/bayserver/common/groups.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#all_groups ⇒ Object
readonly
Returns the value of attribute all_groups.
-
#all_members ⇒ Object
readonly
Returns the value of attribute all_members.
Instance Method Summary collapse
- #get_group(name) ⇒ Object
- #init(bcf) ⇒ Object
-
#initialize ⇒ Groups
constructor
A new instance of Groups.
Constructor Details
#initialize ⇒ Groups
61 62 63 64 |
# File 'lib/baykit/bayserver/common/groups.rb', line 61 def initialize @all_groups = {} @all_members = {} end |
Instance Attribute Details
#all_groups ⇒ Object (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_members ⇒ Object (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 |