Class: Fedora::BaseObject
- Inherits:
-
Object
- Object
- Fedora::BaseObject
- Defined in:
- lib/fedora/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#blob ⇒ Object
Returns the value of attribute blob.
-
#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.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(attrs = nil) ⇒ BaseObject
constructor
Parameters attrs<Hash>:: object attributes -.
- #new_object? ⇒ Boolean
Constructor Details
#initialize(attrs = nil) ⇒ BaseObject
Parameters
- attrs<Hash>
-
object attributes
-
23 24 25 26 27 28 29 |
# File 'lib/fedora/base.rb', line 23 def initialize(attrs = nil) @new_object = true @attributes = attrs || {} @errors = [] @blob = attributes.delete(:blob) @repository = Fedora::Repository.instance end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
16 17 18 |
# File 'lib/fedora/base.rb', line 16 def attributes @attributes end |
#blob ⇒ Object
Returns the value of attribute blob.
16 17 18 |
# File 'lib/fedora/base.rb', line 16 def blob @blob end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
17 18 19 |
# File 'lib/fedora/base.rb', line 17 def errors @errors end |
#new_object=(value) ⇒ Object (writeonly)
Sets the attribute new_object
18 19 20 |
# File 'lib/fedora/base.rb', line 18 def new_object=(value) @new_object = value end |
#uri ⇒ Object
Returns the value of attribute uri.
16 17 18 |
# File 'lib/fedora/base.rb', line 16 def uri @uri end |
Instance Method Details
#[](key) ⇒ Object
31 32 33 |
# File 'lib/fedora/base.rb', line 31 def [](key) @attributes[key] end |
#new_object? ⇒ Boolean
35 36 37 |
# File 'lib/fedora/base.rb', line 35 def new_object? @new_object end |