Class: Her::Base

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::AttributeMethods, ActiveModel::Conversion, Model
Defined in:
lib/her/base.rb

Overview

In case you prefer inheritance over mixins

Instance Attribute Summary

Attributes included from Model::ORM

#data, #errors, #metadata

Class Method Summary collapse

Methods included from Model

#[], #has_key?

Methods included from Model::Relationships

#get_relationship, #has_relationship?

Methods included from Model::Paths

#request_path

Methods included from Model::Introspection

#inspect

Methods included from Model::ORM

#assign_data, #convert_types, #get_data, #has_data?, #id, #initialize, initialize_collection, #method_missing, #respond_to?, use_setter_methods

Methods included from Model::ORM::SerializationMethods

#hash, #to_params

Methods included from Model::ORM::PersistanceMethods

#destroyed?, #new?, #persisted?

Methods included from Model::ORM::ComparisonMethods

#==, #eql?

Methods included from Model::ORM::ErrorMethods

#invalid?, #valid?

Methods included from Model::ORM::UpdateMethods

#update_attribute, #update_attributes, #update_attributes!

Methods included from Model::ORM::SaveMethods

#create_or_update, #save, #save!

Methods included from Model::ORM::DestroyMethods

#delete, #destroy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Her::Model::ORM

Class Method Details

.inherited(klass) ⇒ Object



9
10
11
12
13
14
# File 'lib/her/base.rb', line 9

def inherited(klass)
  klass.root_element(klass.name.demodulize.underscore)
  klass.collection_path(klass.root_element.pluralize)
  klass.resource_path([klass.collection_path, '/:id'].join)
  klass.uses_api(Her::API.default_api)
end