Class: Zm::Client::ConcatMember
- Inherits:
-
Object
- Object
- Zm::Client::ConcatMember
- Includes:
- Inspector
- Defined in:
- lib/zm/client/contact/contact_member.rb
Constant Summary collapse
- INTERNAL =
'C'
- FREE =
'I'
- LDAP =
'G'
- ADD =
'+'
- DEL =
'-'
Instance Attribute Summary collapse
-
#op ⇒ Object
readonly
Returns the value of attribute op.
-
#shared_account_id ⇒ Object
readonly
Returns the value of attribute shared_account_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #add! ⇒ Object
- #current? ⇒ Boolean
- #email_address ⇒ Object
- #free? ⇒ Boolean
-
#initialize(type, value, op = nil) ⇒ ConcatMember
constructor
A new instance of ConcatMember.
- #instance_variables_map ⇒ Object
- #internal? ⇒ Boolean
- #ldap? ⇒ Boolean
- #remove! ⇒ Object
- #shared? ⇒ Boolean
Methods included from Inspector
Constructor Details
#initialize(type, value, op = nil) ⇒ ConcatMember
Returns a new instance of ConcatMember.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/zm/client/contact/contact_member.rb', line 16 def initialize(type, value, op = nil) @shared_account_id = nil @op = op @type = type value_int = value.to_i if !value_int.zero? @value = value_int elsif Zm::Client::Regex::SHARED_CONTACT.match(value) part_value = value.split(':') @shared_account_id = part_value.first @value = part_value.last.to_i else @value = value end end |
Instance Attribute Details
#op ⇒ Object (readonly)
Returns the value of attribute op.
14 15 16 |
# File 'lib/zm/client/contact/contact_member.rb', line 14 def op @op end |
#shared_account_id ⇒ Object (readonly)
Returns the value of attribute shared_account_id.
14 15 16 |
# File 'lib/zm/client/contact/contact_member.rb', line 14 def shared_account_id @shared_account_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'lib/zm/client/contact/contact_member.rb', line 14 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
14 15 16 |
# File 'lib/zm/client/contact/contact_member.rb', line 14 def value @value end |
Instance Method Details
#add! ⇒ Object
54 55 56 |
# File 'lib/zm/client/contact/contact_member.rb', line 54 def add! @op = ADD end |
#current? ⇒ Boolean
50 51 52 |
# File 'lib/zm/client/contact/contact_member.rb', line 50 def current? @op.nil? end |
#email_address ⇒ Object
62 63 64 65 66 |
# File 'lib/zm/client/contact/contact_member.rb', line 62 def email_address return unless ldap? @email_address ||= @value.sub('uid=', '').sub(',ou=people,dc=', '@').gsub(',dc=', '.') end |
#free? ⇒ Boolean
42 43 44 |
# File 'lib/zm/client/contact/contact_member.rb', line 42 def free? @type == FREE end |
#instance_variables_map ⇒ Object
68 69 70 71 |
# File 'lib/zm/client/contact/contact_member.rb', line 68 def instance_variables_map email_address super end |
#internal? ⇒ Boolean
34 35 36 |
# File 'lib/zm/client/contact/contact_member.rb', line 34 def internal? @type == INTERNAL && @value.is_a?(Integer) end |
#ldap? ⇒ Boolean
46 47 48 |
# File 'lib/zm/client/contact/contact_member.rb', line 46 def ldap? @type == LDAP end |
#remove! ⇒ Object
58 59 60 |
# File 'lib/zm/client/contact/contact_member.rb', line 58 def remove! @op = DEL end |
#shared? ⇒ Boolean
38 39 40 |
# File 'lib/zm/client/contact/contact_member.rb', line 38 def shared? @type == INTERNAL && !@shared_account_id.nil? end |