- self.append_extensions
- self.append_inclusions
- self.default_storage_name
- self.descendants
- self.extended
- self.extra_extensions
- self.extra_inclusions
- self.name
- self.new
- self.raise_on_save_failure
- self.raise_on_save_failure=
- all
- assert_valid
- assert_valid_key_size
- at
- const_missing
- copy
- create!
- create
- default_order
- default_repository_name
- default_storage_name
- descendants
- destroy
- destroy!
- each
- fetch
- first
- first_or_create
- first_or_new
- get!
- get
- inherited
- last
- load
- new_collection
- raise_on_save_failure
- raise_on_save_failure=
- repositories
- repository_name
- repository
- reverse
- scoped_query
- storage_name
- storage_names
- update!
- update
- values_at
- self.append_inclusions(*inclusions)
- self.descendants
- self.extra_inclusions
- self.included(model)
- add_to_identity_map
- after_create_hook
- after_destroy_hook
- after_save_hook
- after_update_hook
- assert_not_destroyed
- assert_save_successful
- assert_update_clean_only
- attribute_dirty?
- attribute_get
- attribute_loaded?
- attributes=
- attribute_set
- attributes
- before_create_hook
- before_destroy_hook
- before_save_hook
- before_update_hook
- child_associations
- child_relationships
- clean?
- clear_subjects
- cmp?
- collection
- collection=
- collection_for_self
- conditions
- create_with_hooks
- destroy
- destroy!
- destroyed?
- _destroy
- dirty?
- dirty_attributes
- dirty_children?
- dirty_parents?
- dirty_self?
- eager_load
- eql?
- execute_hooks_for
- fields
- hash
- identity_map
- initialize
- initialize_copy
- inspect
- key
- lazy_load
- new?
- original_attributes
- parent_associations
- parent_relationships
- _persist
- persisted_state
- persisted_state?
- persisted_state=
- properties
- query
- raise_on_save_failure
- raise_on_save_failure=
- readonly?
- relationships
- reload
- remove_from_identity_map
- repository
- repository_name
- reset_key
- run_once
- save
- save!
- save_children
- saved?
- _save
- save_parents
- save_self
- set_default_value
- update!
- update
- update_attributes
- update_with_hooks
Wow, I forgot how many instance methods we have now. It seems like so much when you list it like that. One question that comes to mind is, do we refactor the code when we generalize it for usage by EV and Resource instances?
I see several different concerns when I look at those methods, and it makes me think that we could create objects that are responsible for each of those concerns (like dirty tracking for example), and then have the methods delegate to those. (In the ideal case we'd eventually deprecate those delegate methods and "thin out" the methods in the Resource public API; but that probably comes later on)
Once we have each concern encapsulated in one class, we can generalize things so that they work with both resources and EVs.
I don't know if that's the best approach, but it does seem like a lot of functionality you'd eventually have to duplicate between Resource and EV; it seems like using composition to extend those objects might be a relatively simple approach.