Class: Fedora::BaseObject

Inherits:
Object
  • Object
show all
Defined in:
lib/fedora/base_object.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

-



9
10
11
12
13
14
# File 'lib/fedora/base_object.rb', line 9

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

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



2
3
4
# File 'lib/fedora/base_object.rb', line 2

def attributes
  @attributes
end

#errorsObject (readonly)

Returns the value of attribute errors.



3
4
5
# File 'lib/fedora/base_object.rb', line 3

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.



4
5
6
# File 'lib/fedora/base_object.rb', line 4

def new_object=(value)
  @new_object = value
end

#uriObject

Returns the value of attribute uri.



2
3
4
# File 'lib/fedora/base_object.rb', line 2

def uri
  @uri
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/fedora/base_object.rb', line 2

def url
  @url
end

#xml_contentObject

Returns the value of attribute xml_content.



2
3
4
# File 'lib/fedora/base_object.rb', line 2

def xml_content
  @xml_content
end

Instance Method Details

#new_object?Boolean

Returns:

  • (Boolean)


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

def new_object?
  @new_object
end