cornell_ldap 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/cornell_ldap.gemspec +1 -1
- data/lib/cornell_ldap.rb +5 -5
- data/spec/cornell_ldap_spec.rb +12 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/cornell_ldap.gemspec
CHANGED
data/lib/cornell_ldap.rb
CHANGED
@@ -40,7 +40,7 @@ module CornellLdap
|
|
40
40
|
|
41
41
|
# Returns has representation of on campus address for person if one is
|
42
42
|
# reported.
|
43
|
-
# See CornellLdap::Record#
|
43
|
+
# See CornellLdap::Record#address_attributes for more information.
|
44
44
|
def campus_address
|
45
45
|
unless @campus_address.nil?
|
46
46
|
return @campus_address
|
@@ -52,24 +52,24 @@ module CornellLdap
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Returns local area (Ithaca area) address for person if one is reported
|
55
|
-
# See CornellLdap::Record#
|
55
|
+
# See CornellLdap::Record#address_attributes for more information.
|
56
56
|
def local_address
|
57
57
|
unless @local_address.nil?
|
58
58
|
return @local_address
|
59
59
|
end
|
60
60
|
@local_address = false unless attribute_present?('cornelledulocaladdress') &&
|
61
|
-
@local_address = Record.
|
61
|
+
@local_address = Record.address_attributes(cornelledulocaladdress)
|
62
62
|
return local_address
|
63
63
|
end
|
64
64
|
|
65
65
|
# Returns home address for person if one is reported
|
66
|
-
# See CornellLdap::Record#
|
66
|
+
# See CornellLdap::Record#address_attributes for more information.
|
67
67
|
def home_address
|
68
68
|
unless @home_address.nil?
|
69
69
|
return @home_address
|
70
70
|
end
|
71
71
|
@home_address = false unless attribute_present?('homePostalAddress') &&
|
72
|
-
@home_address = Record.
|
72
|
+
@home_address = Record.address_attributes(homePostalAddress)
|
73
73
|
return home_address
|
74
74
|
end
|
75
75
|
|
data/spec/cornell_ldap_spec.rb
CHANGED
@@ -59,6 +59,18 @@ describe "CornellLdap" do
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
it "should call address_attributes to return local address" do
|
63
|
+
person = mock_person
|
64
|
+
CornellLdap::Record.should_receive(:address_attributes).once.with(person.cornelledulocaladdress)
|
65
|
+
person.local_address
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should call address_attributes to return home address" do
|
69
|
+
person = mock_person
|
70
|
+
CornellLdap::Record.should_receive(:address_attributes).once.with(person.homePostalAddress)
|
71
|
+
person.home_address
|
72
|
+
end
|
73
|
+
|
62
74
|
def mock_person
|
63
75
|
person = CornellLdap::Record.new
|
64
76
|
person.attributes={
|