Class: Fedora::BaseObject
- Inherits:
-
Object
- Object
- Fedora::BaseObject
- Defined in:
- lib/fedora/base_object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#new_object ⇒ Object
writeonly
Sets the attribute new_object.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#url ⇒ Object
Returns the value of attribute url.
-
#xml_content ⇒ Object
Returns the value of attribute xml_content.
Instance Method Summary collapse
-
#initialize(attrs = nil) ⇒ BaseObject
constructor
Parameters attrs<Hash>:: object attributes -.
- #new_object? ⇒ Boolean
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
#attributes ⇒ Object
Returns the value of attribute attributes.
2 3 4 |
# File 'lib/fedora/base_object.rb', line 2 def attributes @attributes end |
#errors ⇒ Object (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
4 5 6 |
# File 'lib/fedora/base_object.rb', line 4 def new_object=(value) @new_object = value end |
#uri ⇒ Object
Returns the value of attribute uri.
2 3 4 |
# File 'lib/fedora/base_object.rb', line 2 def uri @uri end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/fedora/base_object.rb', line 2 def url @url end |
#xml_content ⇒ Object
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
16 17 18 |
# File 'lib/fedora/base_object.rb', line 16 def new_object? @new_object end |