Class: ActiveFedora::Orders::ListNode::MaybeID

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/orders/list_node.rb

Overview

Returns an ID whether or not the given value is a URI.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri_or_id) ⇒ MaybeID

Returns a new instance of MaybeID.



85
86
87
# File 'lib/active_fedora/orders/list_node.rb', line 85

def initialize(uri_or_id)
  @uri_or_id = uri_or_id
end

Instance Attribute Details

#uri_or_idObject (readonly)

Returns the value of attribute uri_or_id.



84
85
86
# File 'lib/active_fedora/orders/list_node.rb', line 84

def uri_or_id
  @uri_or_id
end

Instance Method Details

#valueObject



89
90
91
# File 'lib/active_fedora/orders/list_node.rb', line 89

def value
  id_composite.new([uri_or_id], translator).to_a.first
end