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.
9 10 11 12 |
# File 'lib/ezid/proxy_identifier.rb', line 9 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)
16 17 18 19 20 21 |
# File 'lib/ezid/proxy_identifier.rb', line 16 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.
7 8 9 |
# File 'lib/ezid/proxy_identifier.rb', line 7 def __real @__real end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/ezid/proxy_identifier.rb', line 6 def id @id end |