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.



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

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.



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

def uri_or_id
  @uri_or_id
end

Instance Method Details

#valueObject



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

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