aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/serializers
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/serializers')
-rw-r--r--activemodel/lib/active_model/serializers/json.rb5
-rw-r--r--activemodel/lib/active_model/serializers/xml.rb3
2 files changed, 6 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb
index 90305978c4..918cd0ab76 100644
--- a/activemodel/lib/active_model/serializers/json.rb
+++ b/activemodel/lib/active_model/serializers/json.rb
@@ -2,6 +2,7 @@ require 'active_support/json'
require 'active_support/core_ext/class/attribute'
module ActiveModel
+ # == Active Model JSON Serializer
module Serializers
module JSON
extend ActiveSupport::Concern
@@ -14,8 +15,8 @@ module ActiveModel
self.include_root_in_json = true
end
- # Returns a JSON string representing the model. Some configuration is
- # available through +options+.
+ # Returns a JSON string representing the model. Some configuration can be
+ # passed through +options+.
#
# The option <tt>ActiveModel::Base.include_root_in_json</tt> controls the
# top-level behavior of to_json. It is true by default. When it is <tt>true</tt>,
diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb
index 934af2b8a8..ed64434b8f 100644
--- a/activemodel/lib/active_model/serializers/xml.rb
+++ b/activemodel/lib/active_model/serializers/xml.rb
@@ -5,6 +5,7 @@ require 'active_support/core_ext/hash/conversions'
require 'active_support/core_ext/hash/slice'
module ActiveModel
+ # == Active Model XML Serializer
module Serializers
module Xml
extend ActiveSupport::Concern
@@ -131,6 +132,8 @@ module ActiveModel
end
end
+ # Returns XML representing the model. Configuration can be
+ # passed through +options+.
def to_xml(options = {}, &block)
Serializer.new(self, options).serialize(&block)
end