Sha256: 13a4be43fd074f1a7a855f3598c488edbd92f65b2c3cfb9bbaf2c7d4bb777aab
Contents?: true
Size: 771 Bytes
Versions: 15
Compression:
Stored size: 771 Bytes
Contents
module Acfs::Model # Included by Acfs::Model. Allows a model to belong to a service. # module Service extend ActiveSupport::Concern module ClassMethods # Link to service this model belongs to. Connection settings like base URL # are fetched from service. Return assigned service if no arguments are given. # # Example # class AccountService < Acfs::Client # self.base_url = 'http://acc.serv.org' # end # # class MyUser # service AccountService # end # MyUser.find 5 # Will fetch `http://acc.serv.org/users/5` # def service(klass = nil, options = {}) return @service unless klass @service = klass.new options end end end end
Version data entries
15 entries across 15 versions & 1 rubygems