Class: Avaya::MemberOf

Inherits:
Object
  • Object
show all
Defined in:
lib/avaya/member_of.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ext) ⇒ MemberOf

Returns a new instance of MemberOf.



5
6
7
# File 'lib/avaya/member_of.rb', line 5

def initialize(ext)
  @groups = Avaya::TFTP.read(:member_of, ext)
end

Instance Attribute Details

#groupsObject (readonly)

Returns the value of attribute groups.



3
4
5
# File 'lib/avaya/member_of.rb', line 3

def groups
  @groups
end

Class Method Details

.get(ext) ⇒ Object



9
10
11
12
13
# File 'lib/avaya/member_of.rb', line 9

def self.get ext
  hunt_list = self.new(ext)
  hunt_list.get

end

Instance Method Details

#getObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/avaya/member_of.rb', line 15

def get
  list= []
  groups.each do |group|
    group = group.split(",")
    list << {
        group:    group[0],
        ext:      group[1],
        queue:    group[2],
        group_id: group.last
    }
  end
  list
end