Class: Ezid::ProxyIdentifier
- Inherits:
-
Object
- Object
- Ezid::ProxyIdentifier
- Defined in:
- lib/ezid/proxy_identifier.rb
Instance Attribute Summary collapse
-
#__real ⇒ Object
Returns the value of attribute __real.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id) ⇒ ProxyIdentifier
constructor
A new instance of ProxyIdentifier.
Constructor Details
#initialize(id) ⇒ ProxyIdentifier
Returns a new instance of ProxyIdentifier.
7 8 9 10 |
# File 'lib/ezid/proxy_identifier.rb', line 7 def initialize(id) @id = id @__real = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (protected)
14 15 16 17 18 19 |
# File 'lib/ezid/proxy_identifier.rb', line 14 def method_missing(name, *args, &block) if __real.nil? self.__real = Identifier.find(id) end __real.send(name, *args, &block) end |
Instance Attribute Details
#__real ⇒ Object
Returns the value of attribute __real.
5 6 7 |
# File 'lib/ezid/proxy_identifier.rb', line 5 def __real @__real end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/ezid/proxy_identifier.rb', line 4 def id @id end |