Class: Fedora::BaseObject

Inherits:
Object
  • Object
show all
Defined in:
lib/fedora/base.rb

Direct Known Subclasses

Datastream, FedoraObject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = nil) ⇒ BaseObject

Parameters

attrs<Hash>

object attributes

-



21
22
23
24
25
26
# File 'lib/fedora/base.rb', line 21

def initialize(attrs = nil)
  @new_object = true
  @attributes = attrs || {}
  @errors = []
  @blob = attributes.delete(:blob)
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



14
15
16
# File 'lib/fedora/base.rb', line 14

def attributes
  @attributes
end

#blobObject

Returns the value of attribute blob.



14
15
16
# File 'lib/fedora/base.rb', line 14

def blob
  @blob
end

#errorsObject (readonly)

Returns the value of attribute errors.



15
16
17
# File 'lib/fedora/base.rb', line 15

def errors
  @errors
end

#new_object=(value) ⇒ Object (writeonly)

Sets the attribute new_object

Parameters:

  • value

    the value to set the attribute new_object to.



16
17
18
# File 'lib/fedora/base.rb', line 16

def new_object=(value)
  @new_object = value
end

#uriObject

Returns the value of attribute uri.



14
15
16
# File 'lib/fedora/base.rb', line 14

def uri
  @uri
end

#urlObject

Returns the value of attribute url.



14
15
16
# File 'lib/fedora/base.rb', line 14

def url
  @url
end

Instance Method Details

#new_object?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/fedora/base.rb', line 28

def new_object?
  @new_object
end