Class: ActiveLdap::Adapter::JndiConnection::ModifyRecord
- Inherits:
-
Object
- Object
- ActiveLdap::Adapter::JndiConnection::ModifyRecord
- Defined in:
- lib/active_ldap/adapter/jndi_connection.rb
Constant Summary collapse
- DirContext =
directory.DirContext
- BasicAttribute =
directory.BasicAttribute
- ADD_ATTRIBUTE =
DirContext::ADD_ATTRIBUTE
- REPLACE_ATTRIBUTE =
DirContext::REPLACE_ATTRIBUTE
- REMOVE_ATTRIBUTE =
DirContext::REMOVE_ATTRIBUTE
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #binary? ⇒ Boolean
-
#initialize(type, name, values, binary) ⇒ ModifyRecord
constructor
A new instance of ModifyRecord.
- #to_java_attribute ⇒ Object
- #to_java_modification_item ⇒ Object
Constructor Details
#initialize(type, name, values, binary) ⇒ ModifyRecord
Returns a new instance of ModifyRecord.
42 43 44 45 46 47 |
# File 'lib/active_ldap/adapter/jndi_connection.rb', line 42 def initialize(type, name, values, binary) @type = self.class.const_get("#{type.to_s.upcase}_ATTRIBUTE") @name = name @values = values @binary = binary end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
41 42 43 |
# File 'lib/active_ldap/adapter/jndi_connection.rb', line 41 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
41 42 43 |
# File 'lib/active_ldap/adapter/jndi_connection.rb', line 41 def type @type end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
41 42 43 |
# File 'lib/active_ldap/adapter/jndi_connection.rb', line 41 def values @values end |
Instance Method Details
#binary? ⇒ Boolean
49 50 51 |
# File 'lib/active_ldap/adapter/jndi_connection.rb', line 49 def binary? @binary end |
#to_java_attribute ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/active_ldap/adapter/jndi_connection.rb', line 57 def to_java_attribute attribute = BasicAttribute.new(@name) values = @values values = values.collect(&:to_java_bytes) if binary? values.each do |value| attribute.add(value) end attribute end |
#to_java_modification_item ⇒ Object
53 54 55 |
# File 'lib/active_ldap/adapter/jndi_connection.rb', line 53 def to_java_modification_item ModificationItem.new(@type, to_java_attribute) end |