Sha256: f87f54e2f8679d2a35cbfbf6c238244e50659b81d180d67b13b6b5476e266b7b
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
module Her # This module is the main element of Her. After creating a Her::API object, # include this module in your models to get a few magic methods defined in them. # # @example # class User # include Her::Model # end # # @user = User.new(:name => "RĂ©mi") # @user.save module Model autoload :Base, "her/model/base" autoload :HTTP, "her/model/http" autoload :ORM, "her/model/orm" autoload :Relationships, "her/model/relationships" autoload :Hooks, "her/model/hooks" autoload :Introspection, "her/model/introspection" autoload :Paths, "her/model/paths" extend ActiveSupport::Concern # Instance methods include Her::Model::ORM include Her::Model::Introspection include Her::Model::Paths # Class methods included do extend Her::Model::Base extend Her::Model::HTTP extend Her::Model::ORM extend Her::Model::Relationships extend Her::Model::Hooks extend Her::Model::Paths # Define default settings base_path = self.name.split("::").last.downcase.pluralize collection_path "/#{base_path}" resource_path "/#{base_path}/:id" uses_api Her::API.default_api end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
her-0.2.3 | lib/her/model.rb |
her-0.2.2 | lib/her/model.rb |