Class: AbstractObject
- Inherits:
-
Object
show all
- Defined in:
- lib/abstract_object.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of AbstractObject.
9
10
11
12
|
# File 'lib/abstract_object.rb', line 9
def initialize(options = {})
raise "Definitions can not be empty" if self.class.definitions.empty?
@attributes = rename filter options.kind_of?(AbstractObject) ? options.to_hash : options
end
|
Class Method Details
.accept(key, options = {}) ⇒ Object
3
4
5
6
7
|
# File 'lib/abstract_object.rb', line 3
def self.accept(key, options = {})
key = key.to_sym
set_definitions key, options
define_accessor key, options
end
|
Instance Method Details
#to_hash ⇒ Object
14
15
16
|
# File 'lib/abstract_object.rb', line 14
def to_hash
attributes.dup
end
|