Class: ActiveFedora::RDF::ValueCaster

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/rdf/value_caster.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ValueCaster

Returns a new instance of ValueCaster.



3
4
5
# File 'lib/active_fedora/rdf/value_caster.rb', line 3

def initialize(value)
  @value = value
end

Instance Method Details

#valueObject



7
8
9
10
11
12
13
# File 'lib/active_fedora/rdf/value_caster.rb', line 7

def value
  if @value.respond_to?(:language) # Cast RDF::Literals
    @value.to_s
  else
    @value
  end
end