Class: ActiveCopy::Base
- Inherits:
-
Object
- Object
- ActiveCopy::Base
- Includes:
- Attributes, Finders, Paths, Source, ActiveModel::Model
- Defined in:
- lib/active_copy/base.rb
Constant Summary
Constants included from Attributes
Attributes::DEFAULT_ATTRS, Attributes::DEFAULT_PATH
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
- #method_missing(method, *arguments) ⇒ Object
-
#tags ⇒ Object
Serialize comma-separated tags to an array.
Methods included from Attributes
Methods included from Finders
Methods included from Paths
#collection_path, #index_path, #path, #relative_path, #source_path
Methods included from Source
#present?, #raw_source, #source
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *arguments) ⇒ Object
29 30 31 32 |
# File 'lib/active_copy/base.rb', line 29 def method_missing method, *arguments super method, *arguments unless attribute? "#{method}" attributes[method] end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
14 15 16 |
# File 'lib/active_copy/base.rb', line 14 def id @id end |
Instance Method Details
#tags ⇒ Object
Serialize comma-separated tags to an array.
17 18 19 |
# File 'lib/active_copy/base.rb', line 17 def attributes[:tags].split(',').map(&:strip) end |