Skip to content

Do we want to support method style attribute readers for Net::LDAP::Entry? #117

Open
@jch

Description

@jch

The current implementation of Net::LDAP::Entry#valid_argument? requires an attribute to exist before you can use the method style accessors:

entry = Net::LDAP::Entry.new
entry.respond_to? :sn  # false
entry.sn  # raises NoMethodError

entry[:sn] = "foo"
entry.respond_to? :sn  # true
entry.sn = "bar"
entry.sn   # => "bar"
entry["sn"]  # => "bar"
entry["Sn"] # => "bar"

This feels inconsistent and confusing. For 1.0, I'd like to clearly define how attributes can be accessed.

I looked into RFC 4517 for rules about valid attribute names, but didn't find any.

  • Are attributes case sensitive?
  • Can they have any characters in them?
  • Do we want to support so many different styles of access?

cc @ruby-ldap/ruby-ldap-admins

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions