Class: ROM::LDAP::Attribute
- Inherits:
-
Attribute
- Object
- Attribute
- ROM::LDAP::Attribute
- Extended by:
- Dry::Core::Cache
- Defined in:
- lib/rom/ldap/attribute.rb
Overview
Extended schema attributes tailored for LDAP directories
Class Method Summary collapse
Instance Method Summary collapse
- #!@ ⇒ Array
- #bitwise(value) ⇒ Array (also: #===)
-
#canonical ⇒ LDAP::Attribute
Return a new attribute in its canonical form.
-
#definition ⇒ String
Raw LDAP Attribute Definition.
-
#description ⇒ String
OID description.
-
#editable? ⇒ Boolean
Attribute definition identifies this is not a directory internal attribute and values can be altered.
- #exists ⇒ Array (also: #~@)
- #extensible(value) ⇒ Array
-
#foreign_key ⇒ LDAP::Attribute
Return a new attribute marked as a FK.
- #gt(value) ⇒ Array (also: #>)
- #gte(value) ⇒ Array (also: #>=)
-
#indexed ⇒ LDAP::Attribute
Returns a new attribute marked as indexed.
- #indexed? ⇒ Boolean
- #is(value) ⇒ Array (also: #==)
-
#joined ⇒ LDAP::Attribute
Return a new attribute marked as joined.
-
#joined? ⇒ Boolean
Return if an attribute was used in a join.
- #like(value) ⇒ Array (also: #=~)
- #lt(value) ⇒ Array (also: #<)
- #lte(value) ⇒ Array (also: #<=)
-
#multiple? ⇒ Boolean
OID permits multiple values?.
- #not(value) ⇒ Array (also: #!=)
- #not_like(value) ⇒ Array (also: #!~)
-
#oid ⇒ String
Attribute Numeric Object Identifier.
-
#single? ⇒ Boolean
Attribute definition identifies this attribute can not have multiple values.
-
#syntax ⇒ String
Attribute’s syntax Numeric Object Identifier.
-
#to_s ⇒ String
(also: #original_name)
Convert to string for ldap query using original name The canonical attribute name defined in RFC4512.
Class Method Details
.[](*args) ⇒ ROM::LDAP::Attribute
20 21 22 |
# File 'lib/rom/ldap/attribute.rb', line 20 def self.[](*args) fetch_or_store(args) { new(*args) } end |
Instance Method Details
#!@ ⇒ Array
184 185 186 |
# File 'lib/rom/ldap/attribute.rb', line 184 def !@ [:con_not, exists] end |
#bitwise(value) ⇒ Array Also known as: ===
318 319 320 |
# File 'lib/rom/ldap/attribute.rb', line 318 def bitwise(value) [:op_eql, name, value] end |
#canonical ⇒ LDAP::Attribute
Return a new attribute in its canonical form
158 159 160 161 162 163 164 |
# File 'lib/rom/ldap/attribute.rb', line 158 def canonical if aliased? (alias: nil) else self end end |
#definition ⇒ String
Raw LDAP Attribute Definition.
102 103 104 |
# File 'lib/rom/ldap/attribute.rb', line 102 def definition [:definition] end |
#description ⇒ String
OID description
120 121 122 |
# File 'lib/rom/ldap/attribute.rb', line 120 def description [:description] end |
#editable? ⇒ Boolean
Attribute definition identifies this is not a directory internal attribute and values can be altered.
30 31 32 |
# File 'lib/rom/ldap/attribute.rb', line 30 def editable? [:editable].equal?(true) end |
#exists ⇒ Array Also known as: ~@
173 174 175 |
# File 'lib/rom/ldap/attribute.rb', line 173 def exists [:op_eql, name, :wildcard] end |
#extensible(value) ⇒ Array
309 310 311 |
# File 'lib/rom/ldap/attribute.rb', line 309 def extensible(value) [:op_ext, name, value] end |
#foreign_key ⇒ LDAP::Attribute
Return a new attribute marked as a FK
84 85 86 |
# File 'lib/rom/ldap/attribute.rb', line 84 def foreign_key (foreign_key: true) end |
#gt(value) ⇒ Array Also known as: >
227 228 229 |
# File 'lib/rom/ldap/attribute.rb', line 227 def gt(value) [:con_not, lte(value)] end |
#gte(value) ⇒ Array Also known as: >=
255 256 257 |
# File 'lib/rom/ldap/attribute.rb', line 255 def gte(value) [:op_gte, name, value] end |
#indexed ⇒ LDAP::Attribute
Returns a new attribute marked as indexed
147 148 149 |
# File 'lib/rom/ldap/attribute.rb', line 147 def indexed (index: true) end |
#indexed? ⇒ Boolean
138 139 140 |
# File 'lib/rom/ldap/attribute.rb', line 138 def indexed? [:index].equal?(true) end |
#is(value) ⇒ Array Also known as: ==
199 200 201 |
# File 'lib/rom/ldap/attribute.rb', line 199 def is(value) [:op_eql, name, value] end |
#joined ⇒ LDAP::Attribute
Return a new attribute marked as joined
Whenever you join two schemas, the right schema’s attribute will be marked as joined using this method
60 61 62 |
# File 'lib/rom/ldap/attribute.rb', line 60 def joined (joined: true) end |
#joined? ⇒ Boolean
Return if an attribute was used in a join
75 76 77 |
# File 'lib/rom/ldap/attribute.rb', line 75 def joined? [:joined].equal?(true) end |
#like(value) ⇒ Array Also known as: =~
283 284 285 |
# File 'lib/rom/ldap/attribute.rb', line 283 def like(value) [:op_prx, name, value] end |
#lt(value) ⇒ Array Also known as: <
241 242 243 |
# File 'lib/rom/ldap/attribute.rb', line 241 def lt(value) [:con_not, gte(value)] end |
#lte(value) ⇒ Array Also known as: <=
269 270 271 |
# File 'lib/rom/ldap/attribute.rb', line 269 def lte(value) [:op_lte, name, value] end |
#multiple? ⇒ Boolean
OID permits multiple values?
48 49 50 |
# File 'lib/rom/ldap/attribute.rb', line 48 def multiple? [:single].equal?(false) end |
#not(value) ⇒ Array Also known as: !=
213 214 215 |
# File 'lib/rom/ldap/attribute.rb', line 213 def not(value) [:con_not, is(value)] end |
#not_like(value) ⇒ Array Also known as: !~
297 298 299 |
# File 'lib/rom/ldap/attribute.rb', line 297 def not_like(value) [:con_not, like(value)] end |
#oid ⇒ String
Attribute Numeric Object Identifier
93 94 95 |
# File 'lib/rom/ldap/attribute.rb', line 93 def oid [:oid] end |
#single? ⇒ Boolean
Attribute definition identifies this attribute can not have multiple values.
39 40 41 |
# File 'lib/rom/ldap/attribute.rb', line 39 def single? [:single].equal?(true) end |
#syntax ⇒ String
Attribute’s syntax Numeric Object Identifier
111 112 113 |
# File 'lib/rom/ldap/attribute.rb', line 111 def syntax [:syntax] end |
#to_s ⇒ String Also known as: original_name
Convert to string for ldap query using original name The canonical attribute name defined in RFC4512.
130 131 132 |
# File 'lib/rom/ldap/attribute.rb', line 130 def to_s [:canonical] || name.to_s end |