Module: Restful
- Defined in:
- lib/restful/apimodel/map.rb,
lib/restful.rb,
lib/restful/rails.rb,
lib/restful/apimodel/link.rb,
lib/restful/serializers/base.rb,
lib/restful/apimodel/resource.rb,
lib/restful/apimodel/attribute.rb,
lib/restful/apimodel/collection.rb,
lib/restful/rails/action_controller.rb,
lib/restful/converters/active_record.rb,
lib/restful/serializers/hash_serializer.rb,
lib/restful/serializers/json_serializer.rb,
lib/restful/serializers/params_serializer.rb,
lib/restful/serializers/atom_like_serializer.rb,
lib/restful/rails/active_record/configuration.rb,
lib/restful/rails/active_record/metadata_tools.rb
Overview
Handle ActiveRecord associations and such like.
Defined Under Namespace
Modules: ApiModel, Converters, Rails, Serializers
Constant Summary collapse
Class Method Summary collapse
- .attr(*options) ⇒ Object
-
.cfg(*options) ⇒ Object
Shortcuts past the namespaces.
- .collection(*options) ⇒ Object
- .link(*options) ⇒ Object
-
.method_missing(method, *args, &block) ⇒ Object
Restful.from_xml, #from_atom_like.
- .resource(*options) ⇒ Object
Class Method Details
.attr(*options) ⇒ Object
49 50 51 |
# File 'lib/restful.rb', line 49 def self.attr(*) Restful::ApiModel::Attribute.new(*) end |
.cfg(*options) ⇒ Object
Shortcuts past the namespaces
45 46 47 |
# File 'lib/restful.rb', line 45 def self.cfg(*) Restful::Rails::ActiveRecord::Configuration::Config.new(*) end |
.collection(*options) ⇒ Object
57 58 59 |
# File 'lib/restful.rb', line 57 def self.collection(*) Restful::ApiModel::Collection.new(*) end |
.link(*options) ⇒ Object
53 54 55 |
# File 'lib/restful.rb', line 53 def self.link(*) Restful::ApiModel::Link.new(*) end |
.method_missing(method, *args, &block) ⇒ Object
Restful.from_xml, #from_atom_like. Methods correspond with
resgistered serializers.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/restful.rb', line 28 def self.method_missing(method, *args, &block) if method.to_s.match(/^from_(.*)$/) if serializer_clazz = Restful::Serializers::Base.serializers[type = $1.to_sym] s = serializer_clazz.new s.deserialize(args.first) else super end else super end end |