Class: Ezid::ProxyIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/ezid/proxy_identifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#__realObject

Returns the value of attribute __real.



7
8
9
# File 'lib/ezid/proxy_identifier.rb', line 7

def __real
  @__real
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/ezid/proxy_identifier.rb', line 6

def id
  @id
end