diff --git a/ActionController.html b/ActionController.html
new file mode 100644
index 00000000..a7dcd038
--- /dev/null
+++ b/ActionController.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+ Module: ActionController
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActionController
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/action_controller/serialization.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: Serialization
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActionController/Serialization.html b/ActionController/Serialization.html
new file mode 100644
index 00000000..a4767e60
--- /dev/null
+++ b/ActionController/Serialization.html
@@ -0,0 +1,348 @@
+
+
+
+
+
+ Module: ActionController::Serialization
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActionController::Serialization
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+ Includes:
+ Renderers
+
+
+
+
+
+ Defined in:
+ lib/action_controller/serialization.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) get_serializer (resource, options = {})
+
+
+
+
+
+
+
+
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
+
+ # File 'lib/action_controller/serialization.rb', line 26
+
+def get_serializer ( resource , options = { } )
+ if ! use_adapter?
+ warn ' ActionController::Serialization#use_adapter? has been removed. ' \
+ " Please pass 'adapter: false' or see ActiveSupport::SerializableResource.new "
+ options [ :adapter ] = false
+ end
+ serializable_resource = ActiveModelSerializers :: SerializableResource . new ( resource , options )
+ serializable_resource . serialization_scope ||= options . fetch ( :scope ) { serialization_scope }
+ serializable_resource . serialization_scope_name = options . fetch ( :scope_name ) { _serialization_scope }
+ serializable_resource . adapter . is_a? ( String ) ? serializable_resource . adapter : serializable_resource
+end
+
+
+
+
+
+
+
+
+ - (Object ) serialization_scope
+
+
+
+
+
+
+
+
+
+
+
+21
+22
+23
+24
+
+
+ # File 'lib/action_controller/serialization.rb', line 21
+
+def serialization_scope
+ send ( _serialization_scope ) if _serialization_scope &&
+ respond_to? ( _serialization_scope , true )
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) use_adapter?
+
+
+
+
+
+
+
+
+
+
+
+
+42
+43
+44
+
+
+ # File 'lib/action_controller/serialization.rb', line 42
+
+def use_adapter?
+ true
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActionController/Serialization/ClassMethods.html b/ActionController/Serialization/ClassMethods.html
new file mode 100644
index 00000000..e3dce043
--- /dev/null
+++ b/ActionController/Serialization/ClassMethods.html
@@ -0,0 +1,174 @@
+
+
+
+
+
+ Module: ActionController::Serialization::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActionController::Serialization::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/action_controller/serialization.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) serialization_scope (scope)
+
+
+
+
+
+
+
+
+
+
+
+11
+12
+13
+
+
+ # File 'lib/action_controller/serialization.rb', line 11
+
+def serialization_scope ( scope )
+ self . _serialization_scope = scope
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel.html b/ActiveModel.html
new file mode 100644
index 00000000..1f265b39
--- /dev/null
+++ b/ActiveModel.html
@@ -0,0 +1,129 @@
+
+
+
+
+
+ Module: ActiveModel
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer.rb,
+ lib/active_model/serializer/meta.rb, lib/active_model/serializer/type.rb, lib/active_model/serializer/null.rb, lib/active_model/serializer/field.rb, lib/active_model/serializer/links.rb, lib/active_model/serializer/adapter.rb, lib/active_model/serializer/version.rb, lib/active_model/serializer/caching.rb, lib/active_model/serializer/fieldset.rb, lib/active_model/serializer/attribute.rb, lib/active_model/serializable_resource.rb, lib/active_model/serializer/reflection.rb, lib/active_model/serializer/attributes.rb, lib/active_model/serializer/association.rb, lib/active_model/serializer/adapter/json.rb, lib/active_model/serializer/adapter/null.rb, lib/active_model/serializer/adapter/base.rb, lib/active_model/serializer/associations.rb, lib/active_model/serializer/configuration.rb, lib/active_model/serializer/adapter/json_api.rb, lib/active_model/serializer/adapter/attributes.rb, lib/active_model/serializer/has_one_reflection.rb, lib/active_model/serializer/singular_reflection.rb, lib/active_model/serializer/has_many_reflection.rb, lib/active_model/serializer/collection_reflection.rb, lib/active_model/serializer/belongs_to_reflection.rb, lib/active_model/serializer/collection_serializer.rb
+
+
+
+
+
+
Overview
+
+
+
ActiveModel::Serializer is an abstract class that is reified when
+subclassed to decorate a resource.
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+
+
+ Classes: SerializableResource , Serializer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/SerializableResource.html b/ActiveModel/SerializableResource.html
new file mode 100644
index 00000000..9039e956
--- /dev/null
+++ b/ActiveModel/SerializableResource.html
@@ -0,0 +1,135 @@
+
+
+
+
+
+ Class: ActiveModel::SerializableResource
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::SerializableResource
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModel::SerializableResource
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializable_resource.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer.html b/ActiveModel/Serializer.html
new file mode 100644
index 00000000..df16f761
--- /dev/null
+++ b/ActiveModel/Serializer.html
@@ -0,0 +1,1764 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModel::Serializer
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate , ActiveSupport::Autoload
+
+
+
+
+ Includes:
+ Associations , Attributes , Caching , Configuration , Links , Meta , Type
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer.rb,
+ lib/active_model/serializer/meta.rb, lib/active_model/serializer/type.rb, lib/active_model/serializer/null.rb, lib/active_model/serializer/field.rb, lib/active_model/serializer/links.rb, lib/active_model/serializer/adapter.rb, lib/active_model/serializer/version.rb, lib/active_model/serializer/caching.rb, lib/active_model/serializer/fieldset.rb, lib/active_model/serializer/attribute.rb, lib/active_model/serializer/reflection.rb, lib/active_model/serializer/attributes.rb, lib/active_model/serializer/association.rb, lib/active_model/serializer/adapter/json.rb, lib/active_model/serializer/adapter/null.rb, lib/active_model/serializer/adapter/base.rb, lib/active_model/serializer/associations.rb, lib/active_model/serializer/configuration.rb, lib/active_model/serializer/adapter/json_api.rb, lib/active_model/serializer/array_serializer.rb, lib/active_model/serializer/adapter/attributes.rb, lib/active_model/serializer/has_one_reflection.rb, lib/active_model/serializer/singular_reflection.rb, lib/active_model/serializer/has_many_reflection.rb, lib/active_model/serializer/collection_reflection.rb, lib/active_model/serializer/belongs_to_reflection.rb, lib/active_model/serializer/collection_serializer.rb
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: Adapter , Associations , Attributes , Caching , Configuration , Links , Lint , Meta , Type
+
+
+
+ Classes: ArraySerializer , Association , Attribute , BelongsToReflection , CollectionReflection , CollectionSerializer , ErrorSerializer , ErrorsSerializer , Field , Fieldset , HasManyReflection , HasOneReflection , Null , Reflection , SingularReflection
+
+
+
+
+
Constant Summary
+
+
+
+ SERIALIZABLE_HASH_VALID_KEYS =
+
+
+
+ [ :only , :except , :methods , :include , :root ] . freeze
+
+ VERSION =
+
+
+ ' 0.10.0 ' . freeze
+
+ UndefinedCacheKey =
+
+
+ Class . new ( StandardError )
+
+
+
+
+
+
+
+
+
Constants included
+ from Caching
+
Caching::CALLER_FILE
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute object.
+
+
+
+
+
+
+
+
+ - (Object) root
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute root.
+
+
+
+
+
+
+
+
+ - (Object) scope
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute scope.
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+ - (Object) as_json (adapter_opts = nil)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TODO: When moving attributes adapter logic here, @see #serializable_hash So
+that the below is true: @param options [nil, Hash] The same valid options
+passed to `as_json` (:root, :only, :except, :methods, and :include).
+
+
+
+
+
+
+
+
+ - (Serializer) initialize (object, options = {})
+
+
+
+
+
+
+ constructor
+
+
+
+
+
+
+
+
+
+
`scope_name` is set as :current_user by default in the controller.
+
+
+
+
+
+
+
+
+ - (Object) json_key
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Used by adapter as resource root.
+
+
+
+
+
+
+
+
+ - (Object) read_attribute_for_serialization (attr)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - (Object) relationship_value_for (association, adapter_options, adapter_instance)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+ - (Object) resource_relationships (adapter_options, options, adapter_instance)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+ - (Hash) serializable_hash (adapter_options = nil, options = {}, adapter_instance = self.class.serialization_adapter_instance)
+
+
+
+ (also: #to_hash, #to_h)
+
+
+
+
+
+
+
+
+
+
+
+
+
associations, similar to how ActiveModel::Serializers::JSON is used in
+ActiveRecord::Base.
+
+
+
+
+
+
+
+
+ - (Boolean) success?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods included from Caching
+
#cache_key , #fetch , #fetch_attributes , #fetch_attributes_fragment , #object_cache_key , #serializer_class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#associations
+
+
+
+
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (Serializer ) initialize (object, options = {})
+
+
+
+
+
+
+
+
+
`scope_name` is set as :current_user by default in the controller. If the
+instance does not have a method named `scope_name`, it defines the method
+so that it calls the scope.
+
+
+
+
+
+
+
+
+
+
+
+
+
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+
+
+ # File 'lib/active_model/serializer.rb', line 122
+
+def initialize ( object , options = { } )
+ self . object = object
+ self . instance_options = options
+ self . root = instance_options [ :root ]
+ self . scope = instance_options [ :scope ]
+
+ scope_name = instance_options [ :scope_name ]
+ if scope_name && ! respond_to? ( scope_name )
+ define_singleton_method scope_name , lambda { scope }
+ end
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) object
+
+
+
+
+
+
+
+
+
Returns the value of attribute object
+
+
+
+
+
+
+
+
+
+
+
+
+
+117
+118
+119
+
+
+ # File 'lib/active_model/serializer.rb', line 117
+
+def object
+ @object
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) root
+
+
+
+
+
+
+
+
+
Returns the value of attribute root
+
+
+
+
+
+
+
+
+
+
+
+
+
+117
+118
+119
+
+
+ # File 'lib/active_model/serializer.rb', line 117
+
+def root
+ @root
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) scope
+
+
+
+
+
+
+
+
+
Returns the value of attribute scope
+
+
+
+
+
+
+
+
+
+
+
+
+
+117
+118
+119
+
+
+ # File 'lib/active_model/serializer.rb', line 117
+
+def scope
+ @scope
+end
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) adapter
+
+
+
+
+
+
+
+
+
+
+
+
+53
+54
+55
+
+
+ # File 'lib/active_model/serializer.rb', line 53
+
+def self . adapter
+ ActiveModelSerializers :: Adapter . lookup ( config . adapter )
+end
+
+
+
+
+
+
+
+
+ + (Object ) get_serializer_for (klass)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
Find a serializer from a class and caches the lookup. Preferentially
+returns:
+
+
1. class name appended with "Serializer"
+2. try again with superclass, if present
+3. nil
+
+
+
+
+
+
+
+
+
+
+
+
+
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+
+
+ # File 'lib/active_model/serializer.rb', line 87
+
+def self . get_serializer_for ( klass )
+ return nil unless config . serializer_lookup_enabled
+ serializers_cache . fetch_or_store ( klass ) do
+ serializer_class = serializer_lookup_chain_for ( klass ) . map ( & :safe_constantize ) . find { | x | x && x < ActiveModel :: Serializer }
+
+ if serializer_class
+ serializer_class
+ elsif klass . superclass
+ get_serializer_for ( klass . superclass )
+ end
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) include_directive_from_options (options)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+102
+103
+104
+105
+106
+107
+108
+109
+110
+
+
+ # File 'lib/active_model/serializer.rb', line 102
+
+def self . include_directive_from_options ( options )
+ if options [ :include_directive ]
+ options [ :include_directive ]
+ elsif options [ :include ]
+ JSONAPI :: IncludeDirective . new ( options [ :include ] , allow_wildcard: true )
+ else
+ ActiveModelSerializers . default_include_directive
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) serialization_adapter_instance
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+113
+114
+115
+
+
+ # File 'lib/active_model/serializer.rb', line 113
+
+def self . serialization_adapter_instance
+ @serialization_adapter_instance ||= ActiveModelSerializers :: Adapter :: Attributes
+end
+
+
+
+
+
+
+
+
+ + (ActiveModel::Serializer ) serializer_for (resource, options = {})
+
+
+
+
+
+
+
+
+
Returns Preferentially returns
+
+resource.serializer
+
+ArraySerializer when resource is a collection
+
+options
+
+lookup serializer when resource is a Class
+
+
+
+
+
+
+
+
+
+
+
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
+ # File 'lib/active_model/serializer.rb', line 41
+
+def self . serializer_for ( resource , options = { } )
+ if resource . respond_to? ( :serializer_class )
+ resource . serializer_class
+ elsif resource . respond_to? ( :to_ary )
+ config . collection_serializer
+ else
+ options . fetch ( :serializer ) { get_serializer_for ( resource . class ) }
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) serializer_lookup_chain_for (klass)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
+
+ # File 'lib/active_model/serializer.rb', line 62
+
+def self . serializer_lookup_chain_for ( klass )
+ chain = [ ]
+
+ resource_class_name = klass . name . demodulize
+ resource_namespace = klass . name . deconstantize
+ serializer_class_name = " #{ resource_class_name } Serializer "
+
+ chain . push ( " #{ name } :: #{ serializer_class_name } " ) if self != ActiveModel :: Serializer
+ chain . push ( " #{ resource_namespace } :: #{ serializer_class_name } " )
+
+ chain
+end
+
+
+
+
+
+
+
+
+ + (Object ) serializers_cache
+
+
+
+
+
+
+
+
+
Used to cache serializer name => serializer class when looked up by
+Serializer.get_serializer_for.
+
+
+
+
+
+
+
+
+
+
+
+
+
+77
+78
+79
+
+
+ # File 'lib/active_model/serializer.rb', line 77
+
+def self . serializers_cache
+ @serializers_cache ||= ThreadSafe :: Cache . new
+end
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) as_json (adapter_opts = nil)
+
+
+
+
+
+
+
+
+
TODO: When moving attributes adapter logic here, @see #serializable_hash So
+that the below is true:
+
+
@param options [nil, Hash] The same valid options passed to `as_json`
+ (:root, :only, :except, :methods, and :include).
+The default for `root` is nil.
+The default value for include_root is false. You can change it to true if the given
+JSON string includes a single root node.
+
+
+
+
+
+
+
+
+
+
+185
+186
+187
+
+
+ # File 'lib/active_model/serializer.rb', line 185
+
+def as_json ( adapter_opts = nil )
+ serializable_hash ( adapter_opts )
+end
+
+
+
+
+
+
+
+
+ - (Object ) json_key
+
+
+
+
+
+
+
+
+
Used by adapter as resource root.
+
+
+
+
+
+
+
+
+
+
+
+
+
+190
+191
+192
+
+
+ # File 'lib/active_model/serializer.rb', line 190
+
+def json_key
+ root || _type || object . class . model_name . to_s . underscore
+end
+
+
+
+
+
+
+
+
+ - (Object ) read_attribute_for_serialization (attr)
+
+
+
+
+
+
+
+
+
+
+
+194
+195
+196
+197
+198
+199
+200
+
+
+ # File 'lib/active_model/serializer.rb', line 194
+
+def read_attribute_for_serialization ( attr )
+ if respond_to? ( attr )
+ send ( attr )
+ else
+ object . read_attribute_for_serialization ( attr )
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) relationship_value_for (association, adapter_options, adapter_instance)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
+
+ # File 'lib/active_model/serializer.rb', line 215
+
+def relationship_value_for ( association , adapter_options , adapter_instance )
+ return association . options [ :virtual_value ] if association . options [ :virtual_value ]
+ association_serializer = association . serializer
+ association_object = association_serializer && association_serializer . object
+ return unless association_object
+
+ relationship_value = association_serializer . serializable_hash ( adapter_options , { } , adapter_instance )
+
+ if association . options [ :polymorphic ] && relationship_value
+ polymorphic_type = association_object . class . name . underscore
+ relationship_value = { type: polymorphic_type , polymorphic_type . to_sym => relationship_value }
+ end
+
+ relationship_value
+end
+
+
+
+
+
+
+
+
+ - (Object ) resource_relationships (adapter_options, options, adapter_instance)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+
+
+ # File 'lib/active_model/serializer.rb', line 203
+
+def resource_relationships ( adapter_options , options , adapter_instance )
+ relationships = { }
+ include_directive = options . fetch ( :include_directive )
+ associations ( include_directive ) . each do | association |
+ adapter_opts = adapter_options . merge ( include_directive: include_directive [ association . key ] )
+ relationships [ association . key ] ||= relationship_value_for ( association , adapter_opts , adapter_instance )
+ end
+
+ relationships
+end
+
+
+
+
+
+
+
+
+ - (Hash ) serializable_hash (adapter_options = nil, options = {}, adapter_instance = self.class.serialization_adapter_instance)
+
+
+
+ Also known as:
+ to_hash , to_h
+
+
+
+
+
+
+
+
associations, similar to how ActiveModel::Serializers::JSON is used in
+ActiveRecord::Base.
+
+
TODO: Include ActiveModel::Serializers::JSON. So that the
+below is true:
+
+
@param options [nil, Hash] The same valid options passed to `serializable_hash`
+ (:only, :except, :methods, and :include).
+
+ See
+ https://github.com/rails/rails/blob/v5.0.0.beta2/activemodel/lib/active_model/serializers/json.rb#L17-L101
+ https://github.com/rails/rails/blob/v5.0.0.beta2/activemodel/lib/active_model/serialization.rb#L85-L123
+ https://github.com/rails/rails/blob/v5.0.0.beta2/activerecord/lib/active_record/serialization.rb#L11-L17
+ https://github.com/rails/rails/blob/v5.0.0.beta2/activesupport/lib/active_support/core_ext/object/json.rb#L147-L162
+
+@example
+ # The :only and :except options can be used to limit the attributes included, and work
+ # similar to the attributes method.
+ serializer.as_json(only: [:id, :name])
+ serializer.as_json(except: [:id, :created_at, :age])
+
+ # To include the result of some method calls on the model use :methods:
+ serializer.as_json(methods: :permalink)
+
+ # To include associations use :include:
+ serializer.as_json(include: :posts)
+ # Second level and higher order associations work as well:
+ serializer.as_json(include: { posts: { include: { comments: { only: :body } }, only: :title } })
+
+
+
+
+
+
+
+
+
+
+166
+167
+168
+169
+170
+171
+172
+173
+
+
+ # File 'lib/active_model/serializer.rb', line 166
+
+def serializable_hash ( adapter_options = nil , options = { } , adapter_instance = self . class . serialization_adapter_instance )
+ adapter_options ||= { }
+ options [ :include_directive ] ||= ActiveModel :: Serializer . include_directive_from_options ( adapter_options )
+ cached_attributes = adapter_options [ :cached_attributes ] ||= { }
+ resource = fetch_attributes ( options [ :fields ] , cached_attributes , adapter_instance )
+ relationships = resource_relationships ( adapter_options , options , adapter_instance )
+ resource . merge ( relationships )
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) success?
+
+
+
+
+
+
+
+
+
+
+
+
+134
+135
+136
+
+
+ # File 'lib/active_model/serializer.rb', line 134
+
+def success?
+ true
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Adapter.html b/ActiveModel/Serializer/Adapter.html
new file mode 100644
index 00000000..2b7f099a
--- /dev/null
+++ b/ActiveModel/Serializer/Adapter.html
@@ -0,0 +1,156 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Adapter
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Adapter
+
+ Deprecated
+
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/adapter.rb,
+ lib/active_model/serializer/adapter/json.rb, lib/active_model/serializer/adapter/null.rb, lib/active_model/serializer/adapter/base.rb, lib/active_model/serializer/adapter/json_api.rb, lib/active_model/serializer/adapter/attributes.rb
+
+
+
+
+
+
Overview
+
+
Deprecated.
+
Use ActiveModelSerializers::Adapter instead
+
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+
+
+ Classes: Attributes , Base , Json , JsonApi , Null
+
+
+
+
+
Constant Summary
+
+
+
+ DEPRECATED_METHODS =
+
+
+ [ :create , :adapter_class , :adapter_map , :adapters , :register , :lookup ] . freeze
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Adapter/Attributes.html b/ActiveModel/Serializer/Adapter/Attributes.html
new file mode 100644
index 00000000..2bbf2cb5
--- /dev/null
+++ b/ActiveModel/Serializer/Adapter/Attributes.html
@@ -0,0 +1,248 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Attributes
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Attributes
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveModelSerializers::Adapter::Attributes
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/adapter/attributes.rb
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
#serializable_hash
+
+
+
+
+
+
+
+
+
+
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #serializable_hash , transform , transform_key_casing!
+
+
Constructor Details
+
+
+
+
+ - (Attributes ) initialize (serializer, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of Attributes
+
+
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model/serializer/adapter/attributes.rb', line 5
+
+def initialize ( serializer , options = { } )
+ super ( ActiveModelSerializers :: Adapter :: Attributes . new ( serializer , options ) )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Adapter/Base.html b/ActiveModel/Serializer/Adapter/Base.html
new file mode 100644
index 00000000..c2001f31
--- /dev/null
+++ b/ActiveModel/Serializer/Adapter/Base.html
@@ -0,0 +1,235 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Base
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Base
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveModelSerializers::Adapter::Base
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/adapter/base.rb
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #serializable_hash , transform , transform_key_casing!
+
+
Constructor Details
+
+
+
+
+ - (Base ) initialize (serializer, options = {})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11
+12
+13
+
+
+ # File 'lib/active_model/serializer/adapter/base.rb', line 11
+
+def initialize ( serializer , options = { } )
+ super ( ActiveModelSerializers :: Adapter :: Base . new ( serializer , options ) )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Adapter/Json.html b/ActiveModel/Serializer/Adapter/Json.html
new file mode 100644
index 00000000..9af69a73
--- /dev/null
+++ b/ActiveModel/Serializer/Adapter/Json.html
@@ -0,0 +1,248 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Json
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Json
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveModelSerializers::Adapter::Json
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/adapter/json.rb
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
#meta , #meta_key , #serializable_hash
+
+
+
+
+
+
+
+
+
+
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #serializable_hash , transform , transform_key_casing!
+
+
Constructor Details
+
+
+
+
+ - (Json ) initialize (serializer, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of Json
+
+
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model/serializer/adapter/json.rb', line 5
+
+def initialize ( serializer , options = { } )
+ super ( ActiveModelSerializers :: Adapter :: Json . new ( serializer , options ) )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Adapter/JsonApi.html b/ActiveModel/Serializer/Adapter/JsonApi.html
new file mode 100644
index 00000000..af6c5ed6
--- /dev/null
+++ b/ActiveModel/Serializer/Adapter/JsonApi.html
@@ -0,0 +1,249 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::JsonApi
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::JsonApi
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveModelSerializers::Adapter::JsonApi
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/adapter/json_api.rb
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
default_key_transform , #failure_document , #fragment_cache , fragment_cache , #serializable_hash , #success_document
+
+
+
+
+
+
+
+
+
+
+
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #serializable_hash , transform , transform_key_casing!
+
+
Constructor Details
+
+
+
+
+ - (JsonApi ) initialize (serializer, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of JsonApi
+
+
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model/serializer/adapter/json_api.rb', line 5
+
+def initialize ( serializer , options = { } )
+ super ( ActiveModelSerializers :: Adapter :: JsonApi . new ( serializer , options ) )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Adapter/Null.html b/ActiveModel/Serializer/Adapter/Null.html
new file mode 100644
index 00000000..875f019a
--- /dev/null
+++ b/ActiveModel/Serializer/Adapter/Null.html
@@ -0,0 +1,248 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Null
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Adapter::Null
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveModelSerializers::Adapter::Null
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/adapter/null.rb
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
#serializable_hash
+
+
+
+
+
+
+
+
+
+
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #serializable_hash , transform , transform_key_casing!
+
+
Constructor Details
+
+
+
+
+ - (Null ) initialize (serializer, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of Null
+
+
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model/serializer/adapter/null.rb', line 5
+
+def initialize ( serializer , options = { } )
+ super ( ActiveModelSerializers :: Adapter :: Null . new ( serializer , options ) )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/ArraySerializer.html b/ActiveModel/Serializer/ArraySerializer.html
new file mode 100644
index 00000000..5e680164
--- /dev/null
+++ b/ActiveModel/Serializer/ArraySerializer.html
@@ -0,0 +1,169 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::ArraySerializer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::ArraySerializer
+
+
+
+
+
+
+
+ Inherits:
+
+ CollectionSerializer
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/array_serializer.rb
+
+
+
+
+
+
Constant Summary
+
+
+
+
+
Constant Summary
+
+
+
CollectionSerializer::NoSerializerError
+
+
+
+
+
Instance Attribute Summary
+
+
+
#object , #root
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
#initialize , #json_key , #paginated? , #serializable_hash , #success?
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Association.html b/ActiveModel/Serializer/Association.html
new file mode 100644
index 00000000..fc5f3461
--- /dev/null
+++ b/ActiveModel/Serializer/Association.html
@@ -0,0 +1,592 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Association
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Association
+
+
+
+
+
+
+
+ Inherits:
+
+ Struct
+
+
+ Object
+
+ Struct
+
+ ActiveModel::Serializer::Association
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/association.rb
+
+
+
+
+
Overview
+
+
+
This class hold all information about serializer's association.
+
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) links
+
+
+
+
+
+
+
+
+
Returns the value of attribute links
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/association.rb', line 12
+
+def links
+ @links
+end
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute meta
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/association.rb', line 12
+
+def meta
+ @meta
+end
+
+
+
+
+
+
+
+
+
+
+ - (Symbol ) name
+
+
+
+
+
+
+
+
+
Returns the current value of name
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/association.rb', line 12
+
+def name
+ @name
+end
+
+
+
+
+
+
+
+
+
+
+ - (Hash{Symbol => Object} ) options
+
+
+
+
+
+
+
+
+
Returns the current value of options
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/association.rb', line 12
+
+def options
+ @options
+end
+
+
+
+
+
+
+
+
+
+
+
+
Returns the current value of serializer
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/association.rb', line 12
+
+def serializer
+ @serializer
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Associations.html b/ActiveModel/Serializer/Associations.html
new file mode 100644
index 00000000..abda16ca
--- /dev/null
+++ b/ActiveModel/Serializer/Associations.html
@@ -0,0 +1,272 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Associations
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Associations
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+ Included in:
+ ActiveModel::Serializer
+
+
+
+ Defined in:
+ lib/active_model/serializer/associations.rb
+
+
+
+
+
Overview
+
+
+
Defines an association in the object should be rendered.
+
+
The serializer object should implement the association name as a method
+which should return an array when invoked. If a method with the association
+name does not exist, the association name is dispatched to the serialized
+object.
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Enumerator<Association > ) associations (include_directive = ActiveModelSerializers.default_include_directive)
+
+
+
+
+
+
+
+
+
+
+
+
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+
+
+ # File 'lib/active_model/serializer/associations.rb', line 85
+
+def associations ( include_directive = ActiveModelSerializers . default_include_directive )
+ return unless object
+
+ Enumerator . new do | y |
+ self . class . _reflections . each do | reflection |
+ next if reflection . excluded? ( self )
+ key = reflection . options . fetch ( :key , reflection . name )
+ next unless include_directive . key? ( key )
+ y . yield reflection . build_association ( self , instance_options )
+ end
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Associations/ClassMethods.html b/ActiveModel/Serializer/Associations/ClassMethods.html
new file mode 100644
index 00000000..def9bef6
--- /dev/null
+++ b/ActiveModel/Serializer/Associations/ClassMethods.html
@@ -0,0 +1,497 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Associations::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Associations::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/associations.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (void ) belongs_to (name, options = {}, &block)
+
+
+
+
+
+
+
+
This method returns an undefined value.
+
+
+
+
+
+
+
+
+
+53
+54
+55
+
+
+ # File 'lib/active_model/serializer/associations.rb', line 53
+
+def belongs_to ( name , options = { } , & block )
+ associate ( BelongsToReflection . new ( name , options , block ) )
+end
+
+
+
+
+
+
+
+
+ - (void ) has_many (name, options = {}, &block)
+
+
+
+
+
+
+
+
This method returns an undefined value.
+
+
+
+
+
+
+
+
+
+42
+43
+44
+
+
+ # File 'lib/active_model/serializer/associations.rb', line 42
+
+def has_many ( name , options = { } , & block )
+ associate ( HasManyReflection . new ( name , options , block ) )
+end
+
+
+
+
+
+
+
+
+ - (void ) has_one (name, options = {}, &block)
+
+
+
+
+
+
+
+
This method returns an undefined value.
+
+
+
+
+
+
+
+
+
+64
+65
+66
+
+
+ # File 'lib/active_model/serializer/associations.rb', line 64
+
+def has_one ( name , options = { } , & block )
+ associate ( HasOneReflection . new ( name , options , block ) )
+end
+
+
+
+
+
+
+
+
+ - (Object ) inherited (base)
+
+
+
+
+
+
+
+
+
+
+
+30
+31
+32
+33
+
+
+ # File 'lib/active_model/serializer/associations.rb', line 30
+
+def inherited ( base )
+ super
+ base . _reflections = _reflections . dup
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Attribute.html b/ActiveModel/Serializer/Attribute.html
new file mode 100644
index 00000000..0a597d94
--- /dev/null
+++ b/ActiveModel/Serializer/Attribute.html
@@ -0,0 +1,167 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Attribute
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Attribute
+
+
+
+
+
+
+
+ Inherits:
+
+ Field
+
+
+ Object
+
+ Struct
+
+ Field
+
+ ActiveModel::Serializer::Attribute
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/attribute.rb
+
+
+
+
+
Overview
+
+
+
Holds all the meta-data about an attribute as it was specified in the
+ActiveModel::Serializer class.
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Field
+
#block , #name , #options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Attributes.html b/ActiveModel/Serializer/Attributes.html
new file mode 100644
index 00000000..fa2ad244
--- /dev/null
+++ b/ActiveModel/Serializer/Attributes.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Attributes
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Attributes
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+ Included in:
+ ActiveModel::Serializer
+
+
+
+ Defined in:
+ lib/active_model/serializer/attributes.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Attributes/ClassMethods.html b/ActiveModel/Serializer/Attributes/ClassMethods.html
new file mode 100644
index 00000000..db620e81
--- /dev/null
+++ b/ActiveModel/Serializer/Attributes/ClassMethods.html
@@ -0,0 +1,497 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Attributes::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Attributes::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/attributes.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) _attributes
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
keys of attributes
+
+
+
+
+
+
+
+
+
+
+64
+65
+66
+
+
+ # File 'lib/active_model/serializer/attributes.rb', line 64
+
+def _attributes
+ _attributes_data . keys
+end
+
+
+
+
+
+
+
+
+ - (Object ) _attributes_keys
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
maps attribute value to explict key name
+
+
+
+
+
+
+
+
+
+
+72
+73
+74
+75
+76
+77
+78
+
+
+ # File 'lib/active_model/serializer/attributes.rb', line 72
+
+def _attributes_keys
+ _attributes_data
+ . each_with_object ( { } ) do | ( key , attr ) , hash |
+ next if key == attr . name
+ hash [ attr . name ] = { key: key }
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) attribute (attr, options = {}, &block)
+
+
+
+
+
+
+
+
+
+
+
+
+56
+57
+58
+59
+
+
+ # File 'lib/active_model/serializer/attributes.rb', line 56
+
+def attribute ( attr , options = { } , & block )
+ key = options . fetch ( :key , attr )
+ _attributes_data [ key ] = Attribute . new ( attr , options , block )
+end
+
+
+
+
+
+
+
+
+ - (Object ) attributes (*attrs)
+
+
+
+
+
+
+
+
+
+
+
+
+36
+37
+38
+39
+40
+41
+42
+
+
+ # File 'lib/active_model/serializer/attributes.rb', line 36
+
+def attributes ( * attrs )
+ attrs = attrs . first if attrs . first . class == Array
+
+ attrs . each do | attr |
+ attribute ( attr )
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) inherited (base)
+
+
+
+
+
+
+
+
+
+
+
+28
+29
+30
+31
+
+
+ # File 'lib/active_model/serializer/attributes.rb', line 28
+
+def inherited ( base )
+ super
+ base . _attributes_data = _attributes_data . dup
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/BelongsToReflection.html b/ActiveModel/Serializer/BelongsToReflection.html
new file mode 100644
index 00000000..2f6226bc
--- /dev/null
+++ b/ActiveModel/Serializer/BelongsToReflection.html
@@ -0,0 +1,176 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::BelongsToReflection
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::BelongsToReflection
+
+
+ Private
+
+
+
+
+ Inherits:
+
+ SingularReflection
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/belongs_to_reflection.rb
+
+
+
+
+
+
+
+ This class is part of a private API.
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Field
+
#block , #name , #options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
Methods inherited from Reflection
+
#build_association , #include_data , #initialize , #link , #meta , #value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Caching.html b/ActiveModel/Serializer/Caching.html
new file mode 100644
index 00000000..e59a382d
--- /dev/null
+++ b/ActiveModel/Serializer/Caching.html
@@ -0,0 +1,638 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Caching
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Caching
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+ Included in:
+ ActiveModel::Serializer
+
+
+
+ Defined in:
+ lib/active_model/serializer/caching.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
Constant Summary
+
+
+
+ CALLER_FILE =
+
+
+
+
Matches
+
+
" c:/git/emberjs/ember-crm-backend/app/serializers/lead_serializer.rb:1:in `<top (required)>' "
+AND
+" /c/git/emberjs/ember-crm-backend/app/serializers/lead_serializer.rb:1:in `<top (required)>' "
+AS
+c / git / emberjs / ember - crm - backend / app / serializers / lead_serializer . rb
+
+
+
+
+
+
+
+
+
+
+ /
+ \A # start of string
+ .+ # file path (one or more characters)
+ (?= # stop previous match when
+ :\d+ # a colon is followed by one or more digits
+ :in # followed by a colon followed by in
+ )
+ /x
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) cache_key (adapter_instance)
+
+
+
+
+
+
+
+
+
+
+
+256
+257
+258
+259
+260
+261
+262
+263
+264
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 256
+
+def cache_key ( adapter_instance )
+ return @cache_key if defined? ( @cache_key )
+
+ parts = [ ]
+ parts << object_cache_key
+ parts << adapter_instance . cache_key
+ parts << serializer_class . _cache_digest unless serializer_class . _skip_digest?
+ @cache_key = parts . join ( ' / ' )
+end
+
+
+
+
+
+
+
+
+ - (Object ) fetch (adapter_instance, cache_options = serializer_class._cache_options)
+
+
+
+
+
+
+
+
+
+
+
+220
+221
+222
+223
+224
+225
+226
+227
+228
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 220
+
+def fetch ( adapter_instance , cache_options = serializer_class . _cache_options )
+ if serializer_class . cache_store
+ serializer_class . cache_store . fetch ( cache_key ( adapter_instance ) , cache_options ) do
+ yield
+ end
+ else
+ yield
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) fetch_attributes (fields, cached_attributes, adapter_instance)
+
+
+
+
+
+
+
+
+
INSTANCE METHODS
+
+
+
+
+
+
+
+
+
+
+
+
+
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 205
+
+def fetch_attributes ( fields , cached_attributes , adapter_instance )
+ if serializer_class . cache_enabled?
+ key = cache_key ( adapter_instance )
+ cached_attributes . fetch ( key ) do
+ serializer_class . cache_store . fetch ( key , serializer_class . _cache_options ) do
+ attributes ( fields , true )
+ end
+ end
+ elsif serializer_class . fragment_cache_enabled?
+ fetch_attributes_fragment ( adapter_instance )
+ else
+ attributes ( fields , true )
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) fetch_attributes_fragment (adapter_instance)
+
+
+
+
+
+
+
+
+Determine cached fields from serializer class options
+
+Get non_cached_fields and fetch cache_fields
+
+Merge the two hashes using adapter_instance#fragment_cache
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 233
+
+def fetch_attributes_fragment ( adapter_instance )
+ serializer_class . _cache_options ||= { }
+ serializer_class . _cache_options [ :key ] = serializer_class . _cache_key if serializer_class . _cache_key
+ fields = serializer_class . fragmented_attributes
+
+ non_cached_fields = fields [ :non_cached ] . dup
+ non_cached_hash = attributes ( non_cached_fields , true )
+ include_directive = JSONAPI :: IncludeDirective . new ( non_cached_fields - non_cached_hash . keys )
+ non_cached_hash . merge! resource_relationships ( { } , { include_directive: include_directive } , adapter_instance )
+
+ cached_fields = fields [ :cached ] . dup
+ key = cache_key ( adapter_instance )
+ cached_hash =
+ serializer_class . cache_store . fetch ( key , serializer_class . _cache_options ) do
+ hash = attributes ( cached_fields , true )
+ include_directive = JSONAPI :: IncludeDirective . new ( cached_fields - hash . keys )
+ hash . merge! resource_relationships ( { } , { include_directive: include_directive } , adapter_instance )
+ end
+
+ adapter_instance . fragment_cache ( cached_hash , non_cached_hash )
+end
+
+
+
+
+
+
+
+
+ - (Object ) object_cache_key
+
+
+
+
+
+
+
+
+
Use object's cache_key if available, else derive a key from the object
+Pass the `key` option to the `cache` declaration or override this method to
+customize the cache key
+
+
+
+
+
+
+
+
+
+
+
+
+
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 268
+
+def object_cache_key
+ if object . respond_to? ( :cache_key )
+ object . cache_key
+ elsif ( serializer_cache_key = ( serializer_class . _cache_key || serializer_class . _cache_options [ :key ] ) )
+ object_time_safe = object . updated_at
+ object_time_safe = object_time_safe . strftime ( ' %Y%m%d%H%M%S%9N ' ) if object_time_safe . respond_to? ( :strftime )
+ " #{ serializer_cache_key } / #{ object . id } - #{ object_time_safe } "
+ else
+ fail UndefinedCacheKey , " #{ object . class } must define #cache_key, or the 'key:' option must be passed into ' #{ serializer_class } .cache' "
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializer_class
+
+
+
+
+
+
+
+
+
+
+
+280
+281
+282
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 280
+
+def serializer_class
+ @serializer_class ||= self . class
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Caching/ClassMethods.html b/ActiveModel/Serializer/Caching/ClassMethods.html
new file mode 100644
index 00000000..07bbfa85
--- /dev/null
+++ b/ActiveModel/Serializer/Caching/ClassMethods.html
@@ -0,0 +1,1300 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Caching::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Caching::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/caching.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) _cache_digest
+
+
+
+
+
+
+
+
+
+
+
+48
+49
+50
+51
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 48
+
+def _cache_digest
+ return @_cache_digest if defined? ( @_cache_digest )
+ @_cache_digest = digest_caller_file ( _cache_digest_file_path )
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) _skip_digest?
+
+
+
+
+
+
+
+
+
+
+
+
+67
+68
+69
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 67
+
+def _skip_digest?
+ _cache_options && _cache_options [ :skip_digest ]
+end
+
+
+
+
+
+
+
+
+ - (Object ) cache (options = {})
+
+
+
+
+
+
+
+
+
+
+
+
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 105
+
+def cache ( options = { } )
+ self . _cache =
+ options . delete ( :cache_store ) ||
+ ActiveModelSerializers . config . cache_store ||
+ ActiveSupport :: Cache . lookup_store ( :null_store )
+ self . _cache_key = options . delete ( :key )
+ self . _cache_only = options . delete ( :only )
+ self . _cache_except = options . delete ( :except )
+ self . _cache_options = options . empty? ? nil : options
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) cache_enabled?
+
+
+
+
+
+
+
+
+
+
+
+
+150
+151
+152
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 150
+
+def cache_enabled?
+ perform_caching? && cache_store && ! _cache_only && ! _cache_except
+end
+
+
+
+
+
+
+
+
+ - (Hash ) cache_read_multi (collection_serializer, adapter_instance, include_directive)
+
+
+
+
+
+
+
+
+
Read cache from cache_store
+
+
+
+
+
+
+
+
+
+
+161
+162
+163
+164
+165
+166
+167
+168
+169
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 161
+
+def cache_read_multi ( collection_serializer , adapter_instance , include_directive )
+ return { } if ActiveModelSerializers . config . cache_store . blank?
+
+ keys = object_cache_keys ( collection_serializer , adapter_instance , include_directive )
+
+ return { } if keys . blank?
+
+ ActiveModelSerializers . config . cache_store . read_multi ( * keys )
+end
+
+
+
+
+
+
+
+
+ - (nil , ...) cache_store
+
+
+
+
+
+
+
+
+
The canonical method for getting the cache store for the serializer.
+
+
+
+
+
+
+
+
+
+
+140
+141
+142
+143
+144
+145
+146
+147
+148
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 140
+
+def cache_store
+ return nil if _cache . nil?
+ return _cache if _cache . class != ActiveSupport :: Cache :: NullStore
+ if ActiveModelSerializers . config . cache_store
+ self . _cache = ActiveModelSerializers . config . cache_store
+ else
+ nil
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) digest_caller_file (caller_line)
+
+
+
+
+
+
+
+
+
Hashes contents of file for _cache_digest
+
+
+
+
+
+
+
+
+
+
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 54
+
+def digest_caller_file ( caller_line )
+ serializer_file_path = caller_line [ CALLER_FILE ]
+ serializer_file_contents = IO . read ( serializer_file_path )
+ Digest :: MD5 . hexdigest ( serializer_file_contents )
+rescue TypeError , Errno :: ENOENT
+ warn <<-EOF . strip_heredoc
+ Cannot digest non-existent file: ' #{ caller_line } '.
+ Please set `::_cache_digest` of the serializer
+ if you'd like to cache it.
+ EOF
+ ' ' . freeze
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) fragment_cache_enabled?
+
+
+
+
+
+
+
+
+
+
+
+
+154
+155
+156
+157
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 154
+
+def fragment_cache_enabled?
+ perform_caching? && cache_store &&
+ ( _cache_only && ! _cache_except || ! _cache_only && _cache_except )
+end
+
+
+
+
+
+
+
+
+ - (Object ) fragmented_attributes
+
+
+
+
+
+
+
+
+
+
+
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 71
+
+def fragmented_attributes
+ cached = _cache_only ? _cache_only : _attributes - _cache_except
+ cached = cached . map! { | field | _attributes_keys . fetch ( field , field ) }
+ non_cached = _attributes - cached
+ non_cached = non_cached . map! { | field | _attributes_keys . fetch ( field , field ) }
+ {
+ cached: cached ,
+ non_cached: non_cached
+ }
+end
+
+
+
+
+
+
+
+
+ - (Object ) inherited (base)
+
+
+
+
+
+
+
+
+
+
+
+42
+43
+44
+45
+46
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 42
+
+def inherited ( base )
+ super
+ caller_line = caller [ 1 ]
+ base . _cache_digest_file_path = caller_line
+end
+
+
+
+
+
+
+
+
+ - (String ? ) object_cache_key (serializer, adapter_instance)
+
+
+
+
+
+
+
+
+
Returns the cache_key of the serializer or nil
+
+
+
+
+
+
+
+
+
+
+197
+198
+199
+200
+201
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 197
+
+def object_cache_key ( serializer , adapter_instance )
+ return unless serializer . present? && serializer . object . present?
+
+ serializer . class . cache_enabled? ? serializer . cache_key ( adapter_instance ) : nil
+end
+
+
+
+
+
+
+
+
+ - (Array ) object_cache_keys (collection_serializer, adapter_instance, include_directive)
+
+
+
+
+
+
+
+
+
Find all cache_key for the collection_serializer
+
+
+
+
+
+
+
+
+
+
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 176
+
+def object_cache_keys ( collection_serializer , adapter_instance , include_directive )
+ cache_keys = [ ]
+
+ collection_serializer . each do | serializer |
+ cache_keys << object_cache_key ( serializer , adapter_instance )
+
+ serializer . associations ( include_directive ) . each do | association |
+ if association . serializer . respond_to? ( :each )
+ association . serializer . each do | sub_serializer |
+ cache_keys << object_cache_key ( sub_serializer , adapter_instance )
+ end
+ else
+ cache_keys << object_cache_key ( association . serializer , adapter_instance )
+ end
+ end
+ end
+
+ cache_keys . compact . uniq
+end
+
+
+
+
+
+
+
+
+
+
Value is from ActiveModelSerializers.config.perform_caching. Is used to
+globally enable or disable all serializer caching, just like
+Rails.configuration.action_controller.perform_caching, which is its default
+value in a Rails application. Memoizes value of config first time it is
+called with a non-nil value. rubocop:disable Style/ClassVars
+
+
+
+
+
+
+
+
+
+
+123
+124
+125
+126
+
+
+ # File 'lib/active_model/serializer/caching.rb', line 123
+
+def perform_caching
+ return @@perform_caching if defined? ( @@perform_caching ) && ! @@perform_caching . nil?
+ @@perform_caching = ActiveModelSerializers . config . perform_caching
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/CollectionReflection.html b/ActiveModel/Serializer/CollectionReflection.html
new file mode 100644
index 00000000..b684648a
--- /dev/null
+++ b/ActiveModel/Serializer/CollectionReflection.html
@@ -0,0 +1,172 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::CollectionReflection
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::CollectionReflection
+
+
+ Private
+
+
+
+
+ Inherits:
+
+ Reflection
+
+
+ Object
+
+ Struct
+
+ Field
+
+ Reflection
+
+ ActiveModel::Serializer::CollectionReflection
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/collection_reflection.rb
+
+
+
+
+
+
+
+ This class is part of a private API.
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Field
+
#block , #name , #options
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
Methods inherited from Reflection
+
#build_association , #include_data , #initialize , #link , #meta , #value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/CollectionSerializer.html b/ActiveModel/Serializer/CollectionSerializer.html
new file mode 100644
index 00000000..4067a74e
--- /dev/null
+++ b/ActiveModel/Serializer/CollectionSerializer.html
@@ -0,0 +1,712 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::CollectionSerializer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::CollectionSerializer
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModel::Serializer::CollectionSerializer
+
+
+ show all
+
+
+
+
+
+
+
+
+ Includes:
+ Enumerable
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/collection_serializer.rb
+
+
+
+
+
+
+
Constant Summary
+
+
+
+ NoSerializerError =
+
+
+ Class . new ( StandardError )
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) object
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute object.
+
+
+
+
+
+
+
+
+ - (Object) root
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute root.
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (CollectionSerializer ) initialize (resources, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of CollectionSerializer
+
+
+
+
+
+
+
+
+
+
+
+
+
+10
+11
+12
+13
+14
+15
+
+
+ # File 'lib/active_model/serializer/collection_serializer.rb', line 10
+
+def initialize ( resources , options = { } )
+ @object = resources
+ @options = options
+ @root = options [ :root ]
+ @serializers = serializers_from_resources
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) object
+
+
+
+
+
+
+
+
+
Returns the value of attribute object
+
+
+
+
+
+
+
+
+
+
+
+
+
+8
+9
+10
+
+
+ # File 'lib/active_model/serializer/collection_serializer.rb', line 8
+
+def object
+ @object
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) root
+
+
+
+
+
+
+
+
+
Returns the value of attribute root
+
+
+
+
+
+
+
+
+
+
+
+
+
+8
+9
+10
+
+
+ # File 'lib/active_model/serializer/collection_serializer.rb', line 8
+
+def root
+ @root
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) json_key
+
+
+
+
+
+
+
+
+
TODO: unify naming of root, json_key, and _type. Right now, a
+serializer's json_key comes from the root option or the object's
+model name, by default. But, if a dev defines a custom `json_key` method
+with an explicit value, we have no simple way to know that it is safe to
+call that instance method. (which is really a class property at this point,
+anyhow). rubocop:disable Metrics/CyclomaticComplexity Disabling cop since
+it's good to highlight the complexity of this method by including all
+the logic right here.
+
+
+
+
+
+
+
+
+
+
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
+ # File 'lib/active_model/serializer/collection_serializer.rb', line 39
+
+def json_key
+ return root if root
+ key = object . empty? &&
+ ( explicit_serializer_class = options [ :serializer ] ) &&
+ explicit_serializer_class . _type
+ key ||= ( serializer = serializers . first ) && serializer . json_key
+ key ||= object . respond_to? ( :name ) ? object . name && object . name . underscore : nil
+ key && key . pluralize
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) paginated?
+
+
+
+
+
+
+
+
+
rubocop:enable Metrics/CyclomaticComplexity
+
+
+
+
+
+
+
+
+
+
+54
+55
+56
+57
+58
+
+
+ # File 'lib/active_model/serializer/collection_serializer.rb', line 54
+
+def paginated?
+ object . respond_to? ( :current_page ) &&
+ object . respond_to? ( :total_pages ) &&
+ object . respond_to? ( :size )
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializable_hash (adapter_options, options, adapter_instance)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+22
+23
+24
+25
+26
+27
+28
+29
+
+
+ # File 'lib/active_model/serializer/collection_serializer.rb', line 22
+
+def serializable_hash ( adapter_options , options , adapter_instance )
+ include_directive = ActiveModel :: Serializer . include_directive_from_options ( adapter_options )
+ adapter_options [ :cached_attributes ] ||= ActiveModel :: Serializer . cache_read_multi ( self , adapter_instance , include_directive )
+ adapter_opts = adapter_options . merge ( include_directive: include_directive )
+ serializers . map do | serializer |
+ serializer . serializable_hash ( adapter_opts , options , adapter_instance )
+ end
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) success?
+
+
+
+
+
+
+
+
+
+
+
+
+17
+18
+19
+
+
+ # File 'lib/active_model/serializer/collection_serializer.rb', line 17
+
+def success?
+ true
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Configuration.html b/ActiveModel/Serializer/Configuration.html
new file mode 100644
index 00000000..80471f8d
--- /dev/null
+++ b/ActiveModel/Serializer/Configuration.html
@@ -0,0 +1,119 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Configuration
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Configuration
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+ Includes:
+ ActiveSupport::Configurable
+
+
+
+
+ Included in:
+ ActiveModel::Serializer
+
+
+
+ Defined in:
+ lib/active_model/serializer/configuration.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/ErrorSerializer.html b/ActiveModel/Serializer/ErrorSerializer.html
new file mode 100644
index 00000000..73d59e4d
--- /dev/null
+++ b/ActiveModel/Serializer/ErrorSerializer.html
@@ -0,0 +1,396 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::ErrorSerializer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::ErrorSerializer
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveModel::Serializer
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/error_serializer.rb
+
+
+
+
+
+
Constant Summary
+
+
+
+
+
Constant Summary
+
+
+
SERIALIZABLE_HASH_VALID_KEYS , UndefinedCacheKey , VERSION
+
+
+
+
Constants included
+ from Caching
+
Caching::CALLER_FILE
+
+
+
+
+
Instance Attribute Summary
+
+
+
#object , #root , #scope
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
adapter , get_serializer_for , include_directive_from_options , #initialize , #json_key , #read_attribute_for_serialization , #relationship_value_for , #resource_relationships , #serializable_hash , serialization_adapter_instance , serializer_for , serializer_lookup_chain_for , serializers_cache
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods included from Caching
+
#cache_key , #fetch , #fetch_attributes , #fetch_attributes_fragment , #object_cache_key , #serializer_class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#associations
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Hash<field_name,Array<error_message>> ) as_json
+
+
+
+
+
+
+
+
+
+
+
+
+3
+4
+5
+
+
+ # File 'lib/active_model/serializer/error_serializer.rb', line 3
+
+def as_json
+ object . errors . messages
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) success?
+
+
+
+
+
+
+
+
+
+
+
+
+7
+8
+9
+
+
+ # File 'lib/active_model/serializer/error_serializer.rb', line 7
+
+def success?
+ false
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/ErrorsSerializer.html b/ActiveModel/Serializer/ErrorsSerializer.html
new file mode 100644
index 00000000..be513c49
--- /dev/null
+++ b/ActiveModel/Serializer/ErrorsSerializer.html
@@ -0,0 +1,503 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::ErrorsSerializer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::ErrorsSerializer
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModel::Serializer::ErrorsSerializer
+
+
+ show all
+
+
+
+
+
+
+
+
+ Includes:
+ Enumerable
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/errors_serializer.rb
+
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) object
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute object.
+
+
+
+
+
+
+
+
+ - (Object) root
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute root.
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (ErrorsSerializer ) initialize (resources, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of ErrorsSerializer
+
+
+
+
+
+
+
+
+
+
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/errors_serializer.rb', line 7
+
+def initialize ( resources , options = { } )
+ @root = options [ :root ]
+ @object = resources
+ @serializers = resources . map do | resource |
+ serializer_class = options . fetch ( :serializer ) { ActiveModel :: Serializer :: ErrorSerializer }
+ serializer_class . new ( resource , options . except ( :serializer ) )
+ end
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) object
+
+
+
+
+
+
+
+
+
Returns the value of attribute object
+
+
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model/serializer/errors_serializer.rb', line 5
+
+def object
+ @object
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) root
+
+
+
+
+
+
+
+
+
Returns the value of attribute root
+
+
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model/serializer/errors_serializer.rb', line 5
+
+def root
+ @root
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) json_key
+
+
+
+
+
+
+
+
+
+
+
+20
+21
+22
+
+
+ # File 'lib/active_model/serializer/errors_serializer.rb', line 20
+
+def json_key
+ nil
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) success?
+
+
+
+
+
+
+
+
+
+
+
+
+16
+17
+18
+
+
+ # File 'lib/active_model/serializer/errors_serializer.rb', line 16
+
+def success?
+ false
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Field.html b/ActiveModel/Serializer/Field.html
new file mode 100644
index 00000000..be09521c
--- /dev/null
+++ b/ActiveModel/Serializer/Field.html
@@ -0,0 +1,414 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Field
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Field
+
+
+
+
+
+
+
+ Inherits:
+
+ Struct
+
+
+ Object
+
+ Struct
+
+ ActiveModel::Serializer::Field
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/field.rb
+
+
+
+
+
Overview
+
+
+
Holds all the meta-data about a field (i.e. attribute or association) as it
+was specified in the ActiveModel::Serializer class. Notice that the field
+block is evaluated in the context of the serializer.
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) block
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute block.
+
+
+
+
+
+
+
+
+ - (Object) name
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute name.
+
+
+
+
+
+
+
+
+ - (Object) options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute options.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) block
+
+
+
+
+
+
+
+
+
Returns the value of attribute block
+
+
+
+
+
+
+
+
+
+
+6
+7
+8
+
+
+ # File 'lib/active_model/serializer/field.rb', line 6
+
+def block
+ @block
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) name
+
+
+
+
+
+
+
+
+
Returns the value of attribute name
+
+
+
+
+
+
+
+
+
+
+6
+7
+8
+
+
+ # File 'lib/active_model/serializer/field.rb', line 6
+
+def name
+ @name
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) options
+
+
+
+
+
+
+
+
+
Returns the value of attribute options
+
+
+
+
+
+
+
+
+
+
+6
+7
+8
+
+
+ # File 'lib/active_model/serializer/field.rb', line 6
+
+def options
+ @options
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Fieldset.html b/ActiveModel/Serializer/Fieldset.html
new file mode 100644
index 00000000..bbf63156
--- /dev/null
+++ b/ActiveModel/Serializer/Fieldset.html
@@ -0,0 +1,312 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Fieldset
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Fieldset
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModel::Serializer::Fieldset
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/fieldset.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (Fieldset ) initialize (fields)
+
+
+
+
+
+
+
+
+
Returns a new instance of Fieldset
+
+
+
+
+
+
+
+
+
+
+
+
+
+4
+5
+6
+
+
+ # File 'lib/active_model/serializer/fieldset.rb', line 4
+
+def initialize ( fields )
+ @raw_fields = fields || { }
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) fields
+
+
+
+
+
+
+
+
+
+
+
+8
+9
+10
+
+
+ # File 'lib/active_model/serializer/fieldset.rb', line 8
+
+def fields
+ @fields ||= parsed_fields
+end
+
+
+
+
+
+
+
+
+ - (Object ) fields_for (type)
+
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/fieldset.rb', line 12
+
+def fields_for ( type )
+ fields [ type . singularize . to_sym ] || fields [ type . pluralize . to_sym ]
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/HasManyReflection.html b/ActiveModel/Serializer/HasManyReflection.html
new file mode 100644
index 00000000..9866ab3f
--- /dev/null
+++ b/ActiveModel/Serializer/HasManyReflection.html
@@ -0,0 +1,176 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::HasManyReflection
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::HasManyReflection
+
+
+ Private
+
+
+
+
+ Inherits:
+
+ CollectionReflection
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/has_many_reflection.rb
+
+
+
+
+
+
+
+ This class is part of a private API.
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Field
+
#block , #name , #options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
Methods inherited from Reflection
+
#build_association , #include_data , #initialize , #link , #meta , #value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/HasOneReflection.html b/ActiveModel/Serializer/HasOneReflection.html
new file mode 100644
index 00000000..a30cd7cc
--- /dev/null
+++ b/ActiveModel/Serializer/HasOneReflection.html
@@ -0,0 +1,176 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::HasOneReflection
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::HasOneReflection
+
+
+ Private
+
+
+
+
+ Inherits:
+
+ SingularReflection
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/has_one_reflection.rb
+
+
+
+
+
+
+
+ This class is part of a private API.
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Field
+
#block , #name , #options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
Methods inherited from Reflection
+
#build_association , #include_data , #initialize , #link , #meta , #value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Links.html b/ActiveModel/Serializer/Links.html
new file mode 100644
index 00000000..25df9c08
--- /dev/null
+++ b/ActiveModel/Serializer/Links.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Links
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Links
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+ Included in:
+ ActiveModel::Serializer
+
+
+
+ Defined in:
+ lib/active_model/serializer/links.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Links/ClassMethods.html b/ActiveModel/Serializer/Links/ClassMethods.html
new file mode 100644
index 00000000..3f981578
--- /dev/null
+++ b/ActiveModel/Serializer/Links/ClassMethods.html
@@ -0,0 +1,255 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Links::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Links::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/links.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) inherited (base)
+
+
+
+
+
+
+
+
+
+
+
+16
+17
+18
+19
+
+
+ # File 'lib/active_model/serializer/links.rb', line 16
+
+def inherited ( base )
+ super
+ base . _links = _links . dup
+end
+
+
+
+
+
+
+
+
+ - (Object ) link (name, value = nil, &block)
+
+
+
+
+
+
+
+
+
Define a link on a serializer.
+
+
+
+
+
+
+
+
+
+
+29
+30
+31
+
+
+ # File 'lib/active_model/serializer/links.rb', line 29
+
+def link ( name , value = nil , & block )
+ _links [ name ] = block || value
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Lint.html b/ActiveModel/Serializer/Lint.html
new file mode 100644
index 00000000..3bc6cafc
--- /dev/null
+++ b/ActiveModel/Serializer/Lint.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Lint
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Lint
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/lint.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: Tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Lint/Tests.html b/ActiveModel/Serializer/Lint/Tests.html
new file mode 100644
index 00000000..b34597c4
--- /dev/null
+++ b/ActiveModel/Serializer/Lint/Tests.html
@@ -0,0 +1,910 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Lint::Tests
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Lint::Tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/lint.rb
+
+
+
+
+
Overview
+
+
+
Active Model Serializer Lint Tests
+
+
You can test whether an object is compliant with the Active Model
+Serializers API by including
+ActiveModel::Serializer::Lint::Tests in your TestCase. It will
+include tests that tell you whether your object is fully compliant, or if
+not, which aspects of the API are not implemented.
+
+
Note an object is not required to implement all APIs in order to work with
+Active Model Serializers. This module only intends to provide guidance in
+case you want all features out of the box.
+
+
These tests do not attempt to determine the semantic correctness of the
+returned values. For instance, you could implement
+serializable_hash to always return {} , and the tests would
+pass. It is up to you to ensure that the values are semantically
+meaningful.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) test_active_model_errors
+
+
+
+
+
+
+
+
+
+
+
+122
+123
+124
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 122
+
+def test_active_model_errors
+ assert_respond_to resource , :errors
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_active_model_errors_human_attribute_name
+
+
+
+
+
+
+
+
+
+
+
+126
+127
+128
+129
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 126
+
+def test_active_model_errors_human_attribute_name
+ assert_respond_to resource . class , :human_attribute_name
+ assert_equal ( - 2 , resource . class . method ( :human_attribute_name ) . arity )
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_active_model_errors_lookup_ancestors
+
+
+
+
+
+
+
+
+
+
+
+131
+132
+133
+134
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 131
+
+def test_active_model_errors_lookup_ancestors
+ assert_respond_to resource . class , :lookup_ancestors
+ assert_equal 0 , resource . class . method ( :lookup_ancestors ) . arity
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_as_json
+
+
+
+
+
+
+
+
+
Passes if the object responds to as_json and if it takes zero
+or one arguments. Fails otherwise.
+
+
as_json returns a hash representation of a serialized object.
+It may delegate to serializable_hash Typically, it is
+implemented either by including ActiveModel::Serialization which includes
+ActiveModel::Serializers::JSON. or by the JSON gem when required.
+
+
+
+
+
+
+
+
+
+
+
+
+
+54
+55
+56
+57
+58
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 54
+
+def test_as_json
+ assert_respond_to resource , :as_json
+ resource . as_json
+ resource . as_json ( nil )
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_cache_key
+
+
+
+
+
+
+
+
+
Passes if the object responds to cache_key Fails otherwise.
+
+
cache_key returns a (self-expiring) unique key for the object,
+and is part of the (self-expiring) cache_key, which is used by the adapter.
+It is not required unless caching is enabled.
+
+
+
+
+
+
+
+
+
+
+
+
+
+79
+80
+81
+82
+83
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 79
+
+def test_cache_key
+ assert_respond_to resource , :cache_key
+ actual_arity = resource . method ( :cache_key ) . arity
+ assert_includes [ - 1 , 0 ] , actual_arity , " expected #{ actual_arity . inspect } to be 0 or -1 "
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_id
+
+
+
+
+
+
+
+
+
Passes if the object responds to id and if it takes no
+arguments. Fails otherwise.
+
+
id returns a unique identifier for the object. It is not
+required unless caching is enabled.
+
+
+
+
+
+
+
+
+
+
+
+
+
+104
+105
+106
+107
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 104
+
+def test_id
+ assert_respond_to resource , :id
+ assert_equal 0 , resource . method ( :id ) . arity
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_model_name
+
+
+
+
+
+
+
+
+
Passes if the object's class responds to model_name and if
+it is in an instance of ActiveModel::Name. Fails otherwise.
+
+
model_name returns an ActiveModel::Name instance. It is used
+by the serializer to identify the object's type. It is not required
+unless caching is enabled.
+
+
+
+
+
+
+
+
+
+
+
+
+
+116
+117
+118
+119
+120
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 116
+
+def test_model_name
+ resource_class = resource . class
+ assert_respond_to resource_class , :model_name
+ assert_instance_of resource_class . model_name , ActiveModel :: Name
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_read_attribute_for_serialization
+
+
+
+
+
+
+
+
+
Passes if the object responds to
+read_attribute_for_serialization and if it requires one
+argument (the attribute to be read). Fails otherwise.
+
+
read_attribute_for_serialization gets the attribute value for
+serialization Typically, it is implemented by including
+ActiveModel::Serialization.
+
+
+
+
+
+
+
+
+
+
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 36
+
+def test_read_attribute_for_serialization
+ assert_respond_to resource , :read_attribute_for_serialization , ' The resource should respond to read_attribute_for_serialization '
+ actual_arity = resource . method ( :read_attribute_for_serialization ) . arity
+ assert_equal 1 , actual_arity . abs , " expected #{ actual_arity . inspect } .abs to be 1 or -1 "
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_serializable_hash
+
+
+
+
+
+
+
+
+
Passes if the object responds to serializable_hash and if it
+takes zero or one arguments. Fails otherwise.
+
+
serializable_hash returns a hash representation of a
+object's attributes. Typically, it is implemented by including
+ActiveModel::Serialization.
+
+
+
+
+
+
+
+
+
+
+
+
+
+24
+25
+26
+27
+28
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 24
+
+def test_serializable_hash
+ assert_respond_to resource , :serializable_hash , ' The resource should respond to serializable_hash '
+ resource . serializable_hash
+ resource . serializable_hash ( nil )
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_to_json
+
+
+
+
+
+
+
+
+
Passes if the object responds to to_json and if it takes zero
+or one arguments. Fails otherwise.
+
+
to_json returns a string representation (JSON) of a serialized
+object. It may be called on the result of as_json. Typically,
+it is implemented on all objects when the JSON gem is required.
+
+
+
+
+
+
+
+
+
+
+
+
+
+67
+68
+69
+70
+71
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 67
+
+def test_to_json
+ assert_respond_to resource , :to_json
+ resource . to_json
+ resource . to_json ( nil )
+end
+
+
+
+
+
+
+
+
+ - (Object ) test_updated_at
+
+
+
+
+
+
+
+
+
Passes if the object responds to updated_at and if it takes no
+arguments. Fails otherwise.
+
+
updated_at returns a Time object or iso8601 string and is part
+of the (self-expiring) cache_key, which is used by the adapter. It is not
+required unless caching is enabled.
+
+
+
+
+
+
+
+
+
+
+
+
+
+92
+93
+94
+95
+96
+
+
+ # File 'lib/active_model/serializer/lint.rb', line 92
+
+def test_updated_at
+ assert_respond_to resource , :updated_at
+ actual_arity = resource . method ( :updated_at ) . arity
+ assert_equal 0 , actual_arity
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Meta.html b/ActiveModel/Serializer/Meta.html
new file mode 100644
index 00000000..98bc6172
--- /dev/null
+++ b/ActiveModel/Serializer/Meta.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Meta
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Meta
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+ Included in:
+ ActiveModel::Serializer
+
+
+
+ Defined in:
+ lib/active_model/serializer/meta.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Meta/ClassMethods.html b/ActiveModel/Serializer/Meta/ClassMethods.html
new file mode 100644
index 00000000..3031aa51
--- /dev/null
+++ b/ActiveModel/Serializer/Meta/ClassMethods.html
@@ -0,0 +1,201 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Meta::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Meta::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/meta.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+
+
Set the JSON API meta attribute of a serializer.
+
+
+
+
+
+
+
+
+
+
+23
+24
+25
+
+
+ # File 'lib/active_model/serializer/meta.rb', line 23
+
+def meta ( value = nil , & block )
+ self . _meta = block || value
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Null.html b/ActiveModel/Serializer/Null.html
new file mode 100644
index 00000000..a1b63a2b
--- /dev/null
+++ b/ActiveModel/Serializer/Null.html
@@ -0,0 +1,399 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Null
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Null
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveModel::Serializer
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/null.rb
+
+
+
+
+
+
Constant Summary
+
+
+
+
+
Constant Summary
+
+
+
SERIALIZABLE_HASH_VALID_KEYS , UndefinedCacheKey , VERSION
+
+
+
+
Constants included
+ from Caching
+
Caching::CALLER_FILE
+
+
+
+
+
Instance Attribute Summary
+
+
+
#object , #root , #scope
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
adapter , #as_json , get_serializer_for , include_directive_from_options , #initialize , #json_key , #read_attribute_for_serialization , #relationship_value_for , #resource_relationships , serialization_adapter_instance , serializer_for , serializer_lookup_chain_for , serializers_cache , #success?
+
+
+
+
+
+
+
+
+
+
+
delegate_and_deprecate , deprecate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods included from Caching
+
#cache_key , #fetch , #fetch_attributes , #fetch_attributes_fragment , #object_cache_key , #serializer_class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) associations
+
+
+
+
+
+
+
+
+
+
+
+8
+9
+10
+
+
+ # File 'lib/active_model/serializer/null.rb', line 8
+
+def associations ( * )
+ { }
+end
+
+
+
+
+
+
+
+
+ - (Object ) attributes
+
+
+
+
+
+
+
+
+
+
+
+4
+5
+6
+
+
+ # File 'lib/active_model/serializer/null.rb', line 4
+
+def attributes ( * )
+ { }
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializable_hash
+
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model/serializer/null.rb', line 12
+
+def serializable_hash ( * )
+ { }
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Reflection.html b/ActiveModel/Serializer/Reflection.html
new file mode 100644
index 00000000..f8cb7e3d
--- /dev/null
+++ b/ActiveModel/Serializer/Reflection.html
@@ -0,0 +1,738 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::Reflection
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::Reflection
+
+
+
+
+
+
+
+ Inherits:
+
+ Field
+
+
+ Object
+
+ Struct
+
+ Field
+
+ ActiveModel::Serializer::Reflection
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/reflection.rb
+
+
+
+
+
Overview
+
+
+
Holds all the meta-data about an association as it was specified in the
+ActiveModel::Serializer class.
+
+
Specifically, the association 'comments' is evaluated two different ways:
+1) as 'comments' and named 'comments'.
+2) as 'object.comments.last(1)' and named 'last_comments'.
+
+PostSerializer._reflections #=>
+ # [
+ # HasOneReflection.new(:author, serializer: AuthorSerializer),
+ # HasManyReflection.new(:comments)
+ # HasManyReflection.new(:comments, { key: :last_comments }, #<Block>)
+ # HasManyReflection.new(:secret_meta_data, { if: :is_admin? })
+ # ]
+
+
So you can inspect reflections in your Adapters.
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Field
+
#block , #name , #options
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (Reflection ) initialize
+
+
+
+
+
+
+
+
+
Returns a new instance of Reflection
+
+
+
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+40
+41
+42
+
+
+ # File 'lib/active_model/serializer/reflection.rb', line 37
+
+def initialize ( * )
+ super
+ @_links = { }
+ @_include_data = true
+ @_meta = nil
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) build_association (subject, parent_serializer_options)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
Build association. This method is used internally to build serializer's
+association by its reflection.
+
+
+
+
+
+
+
+
+
+
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
+
+ # File 'lib/active_model/serializer/reflection.rb', line 109
+
+def build_association ( subject , parent_serializer_options )
+ association_value = value ( subject )
+ reflection_options = options . dup
+ serializer_class = subject . class . serializer_for ( association_value , reflection_options )
+ reflection_options [ :include_data ] = @_include_data
+
+ if serializer_class
+ begin
+ serializer = serializer_class . new (
+ association_value ,
+ serializer_options ( subject , parent_serializer_options , reflection_options )
+ )
+ rescue ActiveModel :: Serializer :: CollectionSerializer :: NoSerializerError
+ reflection_options [ :virtual_value ] = association_value . try ( :as_json ) || association_value
+ end
+ elsif ! association_value . nil? && ! association_value . instance_of? ( Object )
+ reflection_options [ :virtual_value ] = association_value
+ end
+
+ Association . new ( name , serializer , reflection_options , @_links , @_meta )
+end
+
+
+
+
+
+
+
+
+ - (Object ) include_data (value = true)
+
+
+
+
+
+
+
+
+
+
+
+54
+55
+56
+57
+
+
+ # File 'lib/active_model/serializer/reflection.rb', line 54
+
+def include_data ( value = true )
+ @_include_data = value
+ :nil
+end
+
+
+
+
+
+
+
+
+ - (Object ) link (name, value = nil, &block)
+
+
+
+
+
+
+
+
+
+
+
+44
+45
+46
+47
+
+
+ # File 'lib/active_model/serializer/reflection.rb', line 44
+
+def link ( name , value = nil , & block )
+ @_links [ name ] = block || value
+ :nil
+end
+
+
+
+
+
+
+
+
+
+
+
+
+49
+50
+51
+52
+
+
+ # File 'lib/active_model/serializer/reflection.rb', line 49
+
+def meta ( value = nil , & block )
+ @_meta = block || value
+ :nil
+end
+
+
+
+
+
+
+
+
+ - (:nil , associated resource or resource collection ) value (serializer) {|ActiveModel::Serializer| ... }
+
+
+
+
+
+
+
+
+
+
+
+
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+
+
+ # File 'lib/active_model/serializer/reflection.rb', line 72
+
+def value ( serializer )
+ @object = serializer . object
+ @scope = serializer . scope
+
+ if block
+ block_value = instance_exec ( serializer , & block )
+ if block_value != :nil
+ block_value
+ elsif @_include_data
+ serializer . read_attribute_for_serialization ( name )
+ end
+ else
+ serializer . read_attribute_for_serialization ( name )
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/SingularReflection.html b/ActiveModel/Serializer/SingularReflection.html
new file mode 100644
index 00000000..8fd952d9
--- /dev/null
+++ b/ActiveModel/Serializer/SingularReflection.html
@@ -0,0 +1,172 @@
+
+
+
+
+
+ Class: ActiveModel::Serializer::SingularReflection
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModel::Serializer::SingularReflection
+
+
+ Private
+
+
+
+
+ Inherits:
+
+ Reflection
+
+
+ Object
+
+ Struct
+
+ Field
+
+ Reflection
+
+ ActiveModel::Serializer::SingularReflection
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/singular_reflection.rb
+
+
+
+
+
+
+
+ This class is part of a private API.
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Field
+
#block , #name , #options
+
+
+
+
+
+
+
+
+
+
Method Summary
+
+
Methods inherited from Reflection
+
#build_association , #include_data , #initialize , #link , #meta , #value
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Type.html b/ActiveModel/Serializer/Type.html
new file mode 100644
index 00000000..d348a2bc
--- /dev/null
+++ b/ActiveModel/Serializer/Type.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Type
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Type
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+ Included in:
+ ActiveModel::Serializer
+
+
+
+ Defined in:
+ lib/active_model/serializer/type.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModel/Serializer/Type/ClassMethods.html b/ActiveModel/Serializer/Type/ClassMethods.html
new file mode 100644
index 00000000..90bbed4a
--- /dev/null
+++ b/ActiveModel/Serializer/Type/ClassMethods.html
@@ -0,0 +1,196 @@
+
+
+
+
+
+ Module: ActiveModel::Serializer::Type::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModel::Serializer::Type::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model/serializer/type.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+ - (Object) type (type)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Set the JSON API type of a serializer.
+
+
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) type (type)
+
+
+
+
+
+
+
+
+
Set the JSON API type of a serializer.
+
+
+
+
+
+
+
+
+
+
+19
+20
+21
+
+
+ # File 'lib/active_model/serializer/type.rb', line 19
+
+def type ( type )
+ self . _type = type && type . to_s
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers.html b/ActiveModelSerializers.html
new file mode 100644
index 00000000..8aed693d
--- /dev/null
+++ b/ActiveModelSerializers.html
@@ -0,0 +1,462 @@
+
+
+
+
+
+ Module: ActiveModelSerializers
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Autoload
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/model.rb,
+ lib/active_model_serializers.rb, lib/active_model_serializers/test.rb, lib/active_model_serializers/railtie.rb, lib/active_model_serializers/adapter.rb, lib/active_model_serializers/logging.rb, lib/active_model_serializers/deprecate.rb, lib/active_model_serializers/callbacks.rb, lib/active_model_serializers/test/schema.rb, lib/active_model_serializers/adapter/base.rb, lib/active_model_serializers/adapter/json.rb, lib/active_model_serializers/json_pointer.rb, lib/active_model_serializers/adapter/null.rb, lib/active_model_serializers/key_transform.rb, lib/active_model_serializers/deserialization.rb, lib/active_model_serializers/test/serializer.rb, lib/active_model_serializers/adapter/json_api.rb, lib/active_model_serializers/adapter/attributes.rb, lib/active_model_serializers/serializable_resource.rb, lib/active_model_serializers/adapter/json_api/meta.rb, lib/active_model_serializers/serialization_context.rb, lib/active_model_serializers/adapter/json_api/link.rb, lib/active_model_serializers/adapter/json_api/error.rb, lib/active_model_serializers/adapter/json_api/jsonapi.rb, lib/active_model_serializers/adapter/json_api/relationship.rb, lib/active_model_serializers/adapter/json_api/deserialization.rb, lib/active_model_serializers/adapter/json_api/pagination_links.rb, lib/active_model_serializers/adapter/json_api/resource_identifier.rb
+
+
+
+
+
+
Overview
+
+
+
JSON API specification rubocop:disable
+Style/AsciiComments TODO: implement!
+
+
☐ https: / /github . com / rails - api / active_model_serializers / issues / 1235
+
+
TODO: use uri_template in link generation?
+
+
☐ https://github.com/rails-api/active_model_serializers/pull/1282#discussion_r42528812
+ see gem https://github.com/hannesg/uri_template
+ spec http://tools.ietf.org/html/rfc6570
+ impl https://developer.github.com/v3/#schema https://api.github.com/
+
+
TODO: validate against a JSON schema document?
+
+
☐ https: / /github . com / rails - api / active_model_serializers / issues / 1162
+☑ https: / /github . com / rails - api / active_model_serializers / pull / 1270
+
+
TODO: Routing
+
+
☐ https: / /github . com / rails - api / active_model_serializers / pull / 1476
+
+
TODO: Query Params
+
+
☑ `include` https://github.com/rails-api/active_model_serializers/pull/1131
+☑ `fields` https://github.com/rails-api/active_model_serializers/pull/700
+☑ `page[number]=3&page[size]=1` https://github.com/rails-api/active_model_serializers/pull/1041
+☐ `filter`
+☐ `sort`
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: Adapter , Callbacks , Deprecate , Deserialization , JsonPointer , Jsonapi , KeyTransform , Logging , Test
+
+
+
+ Classes: Model , Railtie , SerializableResource , SerializationContext
+
+
+
+
+
+
+
+
Class Attribute Summary (collapse )
+
+
+
+
+
+ + (Object) logger
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute logger.
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Attribute Details
+
+
+
+
+
+
+ + (Object ) logger
+
+
+
+
+
+
+
+
+
Returns the value of attribute logger
+
+
+
+
+
+
+
+
+
+
+
+
+
+18
+19
+20
+
+
+ # File 'lib/active_model_serializers.rb', line 18
+
+def logger
+ @logger
+end
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) config
+
+
+
+
+
+
+
+
+
+
+
+21
+22
+23
+
+
+ # File 'lib/active_model_serializers.rb', line 21
+
+def self . config
+ ActiveModel :: Serializer . config
+end
+
+
+
+
+
+
+
+
+ + (JSONAPI::IncludeDirective ) default_include_directive
+
+
+
+
+
+
+
+
+
Memoized default include directive
+
+
+
+
+
+
+
+
+
+
+36
+37
+38
+
+
+ # File 'lib/active_model_serializers.rb', line 36
+
+def self . default_include_directive
+ @default_include_directive ||= JSONAPI :: IncludeDirective . new ( config . default_includes , allow_wildcard: true )
+end
+
+
+
+
+
+
+
+
+ + (Object ) location_of_caller
+
+
+
+
+
+
+
+
+
The file name and line number of the caller of the caller of this method.
+
+
+
+
+
+
+
+
+
+
+
+
+
+26
+27
+28
+29
+30
+31
+32
+
+
+ # File 'lib/active_model_serializers.rb', line 26
+
+def self . location_of_caller
+ caller [ 1 ] =~ / (.*?):(\d+).*?$ /i
+ file = Regexp . last_match ( 1 )
+ lineno = Regexp . last_match ( 2 ) . to_i
+
+ [ file , lineno ]
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter.html b/ActiveModelSerializers/Adapter.html
new file mode 100644
index 00000000..f4a18a03
--- /dev/null
+++ b/ActiveModelSerializers/Adapter.html
@@ -0,0 +1,887 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Autoload
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter.rb,
+ lib/active_model_serializers/adapter/base.rb, lib/active_model_serializers/adapter/json.rb, lib/active_model_serializers/adapter/null.rb, lib/active_model_serializers/adapter/json_api.rb, lib/active_model_serializers/adapter/attributes.rb, lib/active_model_serializers/adapter/json_api/meta.rb, lib/active_model_serializers/adapter/json_api/link.rb, lib/active_model_serializers/adapter/json_api/error.rb, lib/active_model_serializers/adapter/json_api/jsonapi.rb, lib/active_model_serializers/adapter/json_api/relationship.rb, lib/active_model_serializers/adapter/json_api/deserialization.rb, lib/active_model_serializers/adapter/json_api/pagination_links.rb, lib/active_model_serializers/adapter/json_api/resource_identifier.rb
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+
+
+ Classes: Attributes , Base , Json , JsonApi , Null
+
+
+
+
+
Constant Summary
+
+
+
+ UnknownAdapterError =
+
+
+ Class . new ( ArgumentError )
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) adapter_class (adapter)
+
+
+
+
+
+
+
+
+
+
+
+
+27
+28
+29
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 27
+
+def adapter_class ( adapter )
+ ActiveModelSerializers :: Adapter . lookup ( adapter )
+end
+
+
+
+
+
+
+
+
+ + (Hash<adapter_name, adapter_class > ) adapter_map
+
+
+
+
+
+
+
+
+
+
+
+
+32
+33
+34
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 32
+
+def adapter_map
+ ADAPTER_MAP
+end
+
+
+
+
+
+
+
+
+ + (Array<Symbol> ) adapters
+
+
+
+
+
+
+
+
+
Returns list of adapter names
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 37
+
+def adapters
+ adapter_map . keys . sort
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16
+17
+18
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 16
+
+def configured_adapter
+ lookup ( ActiveModelSerializers . config . adapter )
+end
+
+
+
+
+
+
+
+
+ + (Object ) create (resource, options = {})
+
+
+
+
+
+
+
+
+
+
+
+20
+21
+22
+23
+24
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 20
+
+def create ( resource , options = { } )
+ override = options . delete ( :adapter )
+ klass = override ? adapter_class ( override ) : configured_adapter
+ klass . new ( resource , options )
+end
+
+
+
+
+
+
+
+
+
+
Returns subclass of Adapter
+
+
+
+
+
+
+
+
+
+
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 63
+
+def lookup ( adapter )
+ return adapter if adapter . is_a? ( Class )
+ adapter_name = adapter . to_s . underscore
+ adapter_map . fetch ( adapter_name ) do
+ adapter_class = find_by_name ( adapter_name )
+ register ( adapter_name , adapter_class )
+ adapter_class
+ end
+rescue NameError , ArgumentError => e
+ failure_message =
+ " NameError: #{ e . message } . Unknown adapter: #{ adapter . inspect } . Valid adapters are: #{ adapters } "
+ raise UnknownAdapterError , failure_message , e . backtrace
+end
+
+
+
+
+
+
+
+
+ + (Object ) new (*args)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9
+10
+11
+12
+13
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 9
+
+def new ( * args )
+ fail ArgumentError , ' Adapters inherit from Adapter::Base. ' \
+ " Adapter.new called with args: ' #{ args . inspect } ', from " \
+ " 'caller[0]'. "
+end
+
+
+
+
+
+
+
+
+ + (Object ) register (name, klass = name)
+
+
+
+
+
+
+
+
+
+
Note:
+
+
The registered name strips out 'ActiveModelSerializers::Adapter::'
+so that registering 'ActiveModelSerializers::Adapter::Json' and
+'Json' will both register as 'json'.
+
+
+
+
+
Adds an adapter 'klass' with 'name' to the
+'adapter_map' Names are stringified and underscored
+
+
+
+
+
+
+
+
+
+
+50
+51
+52
+53
+54
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 50
+
+def register ( name , klass = name )
+ name = name . to_s . gsub ( / \AActiveModelSerializers::Adapter:: / , ' ' . freeze )
+ adapter_map [ name . underscore ] = klass
+ self
+end
+
+
+
+
+
+
+
+
+ + (Object ) registered_name (adapter_class)
+
+
+
+
+
+
+
+
+
+
+
+56
+57
+58
+
+
+ # File 'lib/active_model_serializers/adapter.rb', line 56
+
+def registered_name ( adapter_class )
+ ADAPTER_MAP . key adapter_class
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/Attributes.html b/ActiveModelSerializers/Adapter/Attributes.html
new file mode 100644
index 00000000..7009a7d1
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/Attributes.html
@@ -0,0 +1,221 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Attributes
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Attributes
+
+
+
+
+
+
+
+ Inherits:
+
+ Base
+
+
+ Object
+
+ Base
+
+ ActiveModelSerializers::Adapter::Attributes
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/attributes.rb
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Base
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods inherited from Base
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #initialize , transform , transform_key_casing!
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) serializable_hash (options = nil)
+
+
+
+
+
+
+
+
+
+
+
+4
+5
+6
+7
+8
+
+
+ # File 'lib/active_model_serializers/adapter/attributes.rb', line 4
+
+def serializable_hash ( options = nil )
+ options = serialization_options ( options )
+ options [ :fields ] ||= instance_options [ :fields ]
+ serializer . serializable_hash ( instance_options , options , self )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/Base.html b/ActiveModelSerializers/Adapter/Base.html
new file mode 100644
index 00000000..7305c021
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/Base.html
@@ -0,0 +1,1082 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Base
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Base
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Adapter::Base
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/base.rb
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) instance_options
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute instance_options.
+
+
+
+
+
+
+
+
+ - (Object) serializer
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute serializer.
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (Base ) initialize (serializer, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of Base
+
+
+
+
+
+
+
+
+
+
+
+
+
+47
+48
+49
+50
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 47
+
+def initialize ( serializer , options = { } )
+ @serializer = serializer
+ @instance_options = options
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) instance_options
+
+
+
+
+
+
+
+
+
Returns the value of attribute instance_options
+
+
+
+
+
+
+
+
+
+
+
+
+
+45
+46
+47
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 45
+
+def instance_options
+ @instance_options
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) serializer
+
+
+
+
+
+
+
+
+
Returns the value of attribute serializer
+
+
+
+
+
+
+
+
+
+
+
+
+
+45
+46
+47
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 45
+
+def serializer
+ @serializer
+end
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) cache_key
+
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 37
+
+def self . cache_key
+ @cache_key ||= ActiveModelSerializers :: Adapter . registered_name ( self )
+end
+
+
+
+
+
+
+
+
+
+
Sets the default transform for the adapter.
+
+
+
+
+
+
+
+
+
+
+14
+15
+16
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 14
+
+def self . default_key_transform
+ :unaltered
+end
+
+
+
+
+
+
+
+
+ + (Object ) fragment_cache (cached_hash, non_cached_hash)
+
+
+
+
+
+
+
+
+
+
+
+41
+42
+43
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 41
+
+def self . fragment_cache ( cached_hash , non_cached_hash )
+ non_cached_hash . merge cached_hash
+end
+
+
+
+
+
+
+
+
+ + (Object ) inherited (subclass)
+
+
+
+
+
+
+
+
+
Automatically register adapters when subclassing
+
+
+
+
+
+
+
+
+
+
+
+
+
+7
+8
+9
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 7
+
+def self . inherited ( subclass )
+ ActiveModelSerializers :: Adapter . register ( subclass )
+end
+
+
+
+
+
+
+
+
+
+
Determines the transform to use in order of precedence:
+
+
adapter option, global config, adapter default.
+
+
+
+
+
+
+
+
+
+
+23
+24
+25
+26
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 23
+
+def self . transform ( options )
+ return options [ :key_transform ] if options && options [ :key_transform ]
+ ActiveModelSerializers . config . key_transform || default_key_transform
+end
+
+
+
+
+
+
+
+
+
+
Transforms the casing of the supplied value.
+
+
+
+
+
+
+
+
+
+
+33
+34
+35
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 33
+
+def self . transform_key_casing! ( value , options )
+ KeyTransform . send ( transform ( options ) , value )
+end
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) as_json (options = nil)
+
+
+
+
+
+
+
+
+
+
+
+58
+59
+60
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 58
+
+def as_json ( options = nil )
+ serializable_hash ( options )
+end
+
+
+
+
+
+
+
+
+ - (Object ) cache_key
+
+
+
+
+
+
+
+
+
+
+
+62
+63
+64
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 62
+
+def cache_key
+ self . class . cache_key
+end
+
+
+
+
+
+
+
+
+ - (Object ) fragment_cache (cached_hash, non_cached_hash)
+
+
+
+
+
+
+
+
+
+
+
+66
+67
+68
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 66
+
+def fragment_cache ( cached_hash , non_cached_hash )
+ self . class . fragment_cache ( cached_hash , non_cached_hash )
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializable_hash (_options = nil)
+
+
+
+
+
+
+
+
+
Subclasses that implement this method must first call
+
+
options = serialization_options ( options )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+54
+55
+56
+
+
+ # File 'lib/active_model_serializers/adapter/base.rb', line 54
+
+def serializable_hash ( _options = nil )
+ fail NotImplementedError , ' This is an abstract method. Should be implemented at the concrete adapter. '
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/Json.html b/ActiveModelSerializers/Adapter/Json.html
new file mode 100644
index 00000000..7e5d2834
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/Json.html
@@ -0,0 +1,329 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Json
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Json
+
+
+
+
+
+
+
+ Inherits:
+
+ Base
+
+
+ Object
+
+ Base
+
+ ActiveModelSerializers::Adapter::Json
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json.rb
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Base
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods inherited from Base
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #initialize , transform , transform_key_casing!
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model_serializers/adapter/json.rb', line 12
+
+def meta
+ instance_options . fetch ( :meta , nil )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+16
+17
+18
+
+
+ # File 'lib/active_model_serializers/adapter/json.rb', line 16
+
+def meta_key
+ instance_options . fetch ( :meta_key , ' meta ' . freeze )
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializable_hash (options = nil)
+
+
+
+
+
+
+
+
+
+
+
+4
+5
+6
+7
+8
+9
+10
+
+
+ # File 'lib/active_model_serializers/adapter/json.rb', line 4
+
+def serializable_hash ( options = nil )
+ options = serialization_options ( options )
+ serialized_hash = { root => Attributes . new ( serializer , instance_options ) . serializable_hash ( options ) }
+ serialized_hash [ meta_key ] = meta unless meta . blank?
+
+ self . class . transform_key_casing! ( serialized_hash , instance_options )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi.html b/ActiveModelSerializers/Adapter/JsonApi.html
new file mode 100644
index 00000000..6dc51698
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi.html
@@ -0,0 +1,860 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi
+
+
+
+
+
+
+
+ Inherits:
+
+ Base
+
+
+ Object
+
+ Base
+
+ ActiveModelSerializers::Adapter::JsonApi
+
+
+ show all
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Autoload
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api.rb,
+ lib/active_model_serializers/adapter/json_api/meta.rb, lib/active_model_serializers/adapter/json_api/link.rb, lib/active_model_serializers/adapter/json_api/error.rb, lib/active_model_serializers/adapter/json_api/jsonapi.rb, lib/active_model_serializers/adapter/json_api/relationship.rb, lib/active_model_serializers/adapter/json_api/deserialization.rb, lib/active_model_serializers/adapter/json_api/pagination_links.rb, lib/active_model_serializers/adapter/json_api/resource_identifier.rb
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: Deserialization , Error , Jsonapi
+
+
+
+ Classes: Link , Meta , PaginationLinks , Relationship , ResourceIdentifier
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Base
+
#instance_options , #serializer
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+ - (Object) failure_document
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
JSON API Errors TODO: look into caching
+definition: ☑ toplevel_errors array (required) ☐ toplevel_meta ☐
+toplevel_jsonapi structure: { errors: toplevel_errors, meta:
+toplevel_meta, jsonapi: toplevel_jsonapi }.reject! {|_,v| v.nil? }
+prs: https://github.com/rails-api/active_model_serializers/pull/1004.
+
+
+
+
+
+
+
+
+ - (Object) fragment_cache (cached_hash, non_cached_hash)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - (JsonApi) initialize (serializer, options = {})
+
+
+
+
+
+
+ constructor
+
+
+
+
+
+
+
+
+
+
A new instance of JsonApi.
+
+
+
+
+
+
+
+
+ - (Object) serializable_hash
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - (Object) success_document
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Primary data definition:
+☐ toplevel_data (required) ☐ toplevel_included ☑ toplevel_meta ☑
+toplevel_links ☑ toplevel_jsonapi structure: { data: toplevel_data,
+included: toplevel_included, meta: toplevel_meta, links:
+toplevel_links, jsonapi: toplevel_jsonapi }.reject! {|_,v| v.nil? }
+rubocop:disable Metrics/CyclomaticComplexity.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods inherited from Base
+
#as_json , #cache_key , cache_key , inherited , transform , transform_key_casing!
+
+
Constructor Details
+
+
+
+
+ - (JsonApi ) initialize (serializer, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of JsonApi
+
+
+
+
+
+
+
+
+
+
+
+
+
+49
+50
+51
+52
+53
+
+
+ # File 'lib/active_model_serializers/adapter/json_api.rb', line 49
+
+def initialize ( serializer , options = { } )
+ super
+ @include_directive = JSONAPI :: IncludeDirective . new ( options [ :include ] , allow_wildcard: true )
+ @fieldset = options [ :fieldset ] || ActiveModel :: Serializer :: Fieldset . new ( options . delete ( :fields ) )
+end
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+
+
+
+
+34
+35
+36
+
+
+ # File 'lib/active_model_serializers/adapter/json_api.rb', line 34
+
+def self . default_key_transform
+ :dash
+end
+
+
+
+
+
+
+
+
+ + (Object ) fragment_cache (cached_hash, non_cached_hash, root = true)
+
+
+
+
+
+
+
+
+
+
+
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
+
+ # File 'lib/active_model_serializers/adapter/json_api.rb', line 38
+
+def self . fragment_cache ( cached_hash , non_cached_hash , root = true )
+ core_cached = cached_hash . first
+ core_non_cached = non_cached_hash . first
+ no_root_cache = cached_hash . delete_if { | key , _value | key == core_cached [ 0 ] }
+ no_root_non_cache = non_cached_hash . delete_if { | key , _value | key == core_non_cached [ 0 ] }
+ cached_resource = ( core_cached [ 1 ] ) ? core_cached [ 1 ] . deep_merge ( core_non_cached [ 1 ] ) : core_non_cached [ 1 ]
+ hash = root ? { root => cached_resource } : cached_resource
+
+ hash . deep_merge no_root_non_cache . deep_merge no_root_cache
+end
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) failure_document
+
+
+
+
+
+
+
+
+
JSON API Errors TODO: look into caching
+definition:
+
+
☑ toplevel_errors array ( required )
+☐ toplevel_meta
+☐ toplevel_jsonapi
+
+
+
structure:
+
+
{
+ errors: toplevel_errors ,
+ meta: toplevel_meta ,
+ jsonapi: toplevel_jsonapi
+} . reject! { | _ , v | v . nil? }
+
+
+
prs:
+
+
https :/ / github . com / rails - api / active_model_serializers / pull / 1004
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
+ # File 'lib/active_model_serializers/adapter/json_api.rb', line 170
+
+def failure_document
+ hash = { }
+
+ if serializer . respond_to? ( :each )
+ hash [ :errors ] = serializer . flat_map do | error_serializer |
+ Error . resource_errors ( error_serializer , instance_options )
+ end
+ else
+ hash [ :errors ] = Error . resource_errors ( serializer , instance_options )
+ end
+ hash
+end
+
+
+
+
+
+
+
+
+ - (Object ) fragment_cache (cached_hash, non_cached_hash)
+
+
+
+
+
+
+
+
+
+
+
+66
+67
+68
+69
+
+
+ # File 'lib/active_model_serializers/adapter/json_api.rb', line 66
+
+def fragment_cache ( cached_hash , non_cached_hash )
+ root = ! instance_options . include? ( :include )
+ self . class . fragment_cache ( cached_hash , non_cached_hash , root )
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializable_hash
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+57
+58
+59
+60
+61
+62
+63
+64
+
+
+ # File 'lib/active_model_serializers/adapter/json_api.rb', line 57
+
+def serializable_hash ( * )
+ document = if serializer . success?
+ success_document
+ else
+ failure_document
+ end
+ self . class . transform_key_casing! ( document , instance_options )
+end
+
+
+
+
+
+
+
+
+ - (Object ) success_document
+
+
+
+
+
+
+
+
+
Primary data definition:
+
+
☐ toplevel_data ( required )
+☐ toplevel_included
+☑ toplevel_meta
+☑ toplevel_links
+☑ toplevel_jsonapi
+
+
+
structure:
+
+
{
+ data: toplevel_data ,
+ included: toplevel_included ,
+ meta: toplevel_meta ,
+ links: toplevel_links ,
+ jsonapi: toplevel_jsonapi
+} . reject! { | _ , v | v . nil? }
+
+
+
rubocop:disable Metrics/CyclomaticComplexity
+
+
+
+
+
+
+
+
+
+
+
+
+
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+
+
+ # File 'lib/active_model_serializers/adapter/json_api.rb', line 87
+
+def success_document
+ is_collection = serializer . respond_to? ( :each )
+ serializers = is_collection ? serializer : [ serializer ]
+ primary_data , included = resource_objects_for ( serializers )
+
+ hash = { }
+ hash [ :data ] = is_collection ? primary_data : primary_data [ 0 ]
+ hash [ :included ] = included if included . any?
+
+ Jsonapi . add! ( hash )
+
+ if instance_options [ :links ]
+ hash [ :links ] ||= { }
+ hash [ :links ] . update ( instance_options [ :links ] )
+ end
+
+ if is_collection && serializer . paginated?
+ hash [ :links ] ||= { }
+ hash [ :links ] . update ( ( serializer ) )
+ end
+
+ hash [ :meta ] = instance_options [ :meta ] unless instance_options [ :meta ] . blank?
+
+ hash
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/Deserialization.html b/ActiveModelSerializers/Adapter/JsonApi/Deserialization.html
new file mode 100644
index 00000000..16dc0117
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/Deserialization.html
@@ -0,0 +1,1059 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter::JsonApi::Deserialization
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter::JsonApi::Deserialization
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/deserialization.rb
+
+
+
+
+
Overview
+
+
+
NOTE(Experimental): This is an experimental feature. Both the interface and
+internals could be subject to changes.
+
+
+
+
+
+
+
+
+
Constant Summary
+
+
+
+ InvalidDocument =
+
+
+ Class . new ( ArgumentError )
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+ + (Object) field_key (field, options)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+ + (Object) filter_fields (fields, options)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+ + (Object) parse (document, options = {})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Same as parse!, but returns an empty hash instead of raising
+InvalidDocument on invalid payloads.
+
+
+
+
+
+
+
+
+ + (Hash) parse! (document, options = {})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Transform a JSON API document, containing a single data object, into a hash
+that is ready for ActiveRecord::Base.new() and such.
+
+
+
+
+
+
+
+
+ + (Object) parse_attributes (attributes, options)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+ + (Hash{Symbol, Object}) parse_relationship (assoc_name, assoc_data, options)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
Given an association name, and a relationship data attribute, build a hash
+mapping the corresponding ActiveRecord attribute to the corresponding
+value.
+
+
+
+
+
+
+
+
+ + (Object) parse_relationships (relationships, options)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+ + (Object) transform_keys (hash, options)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+ + (Object) validate_payload (payload)
+
+
+
+
+
+
+
+
+
+
+ private
+
+
+
+
Checks whether a payload is compliant with the JSON API spec.
+
+
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) field_key (field, options)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+152
+153
+154
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 152
+
+def field_key ( field , options )
+ ( options [ :keys ] || { } ) . fetch ( field . to_sym , field ) . to_sym
+end
+
+
+
+
+
+
+
+
+ + (Object ) filter_fields (fields, options)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+143
+144
+145
+146
+147
+148
+149
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 143
+
+def filter_fields ( fields , options )
+ if ( only = options [ :only ] )
+ fields . slice! ( * Array ( only ) . map ( & :to_s ) )
+ elsif ( except = options [ :except ] )
+ fields . except! ( * Array ( except ) . map ( & :to_s ) )
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) parse (document, options = {})
+
+
+
+
+
+
+
+
+
Same as parse!, but returns an empty hash instead of raising
+InvalidDocument on invalid payloads.
+
+
+
+
+
+
+
+
+
+
+
+
+
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 83
+
+def parse ( document , options = { } )
+ document = document . dup . permit! . to_h if document . is_a? ( ActionController :: Parameters )
+
+ validate_payload ( document ) do | invalid_document , reason |
+ yield invalid_document , reason if block_given?
+ return { }
+ end
+
+ primary_data = document [ ' data ' ]
+ attributes = primary_data [ ' attributes ' ] || { }
+ attributes [ ' id ' ] = primary_data [ ' id ' ] if primary_data [ ' id ' ]
+ relationships = primary_data [ ' relationships ' ] || { }
+
+ filter_fields ( attributes , options )
+ filter_fields ( relationships , options )
+
+ hash = { }
+ hash . merge! ( parse_attributes ( attributes , options ) )
+ hash . merge! ( parse_relationships ( relationships , options ) )
+
+ hash
+end
+
+
+
+
+
+
+
+
+ + (Hash ) parse! (document, options = {})
+
+
+
+
+
+
+
+
+
Transform a JSON API document, containing a single data object, into a hash
+that is ready for ActiveRecord::Base.new() and such. Raises InvalidDocument
+if the payload is not properly formatted.
+
+
+
+
+
+
+
+
+
+
+75
+76
+77
+78
+79
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 75
+
+def parse! ( document , options = { } )
+ parse ( document , options ) do | invalid_payload , reason |
+ fail InvalidDocument , " Invalid payload ( #{ reason } ): #{ invalid_payload } "
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) parse_attributes (attributes, options)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+157
+158
+159
+160
+161
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 157
+
+def parse_attributes ( attributes , options )
+ transform_keys ( attributes , options )
+ . map { | ( k , v ) | { field_key ( k , options ) => v } }
+ . reduce ( { } , :merge )
+end
+
+
+
+
+
+
+
+
+ + (Hash{Symbol, Object} ) parse_relationship (assoc_name, assoc_data, options)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
Given an association name, and a relationship data attribute, build a hash
+mapping the corresponding ActiveRecord attribute to the corresponding
+value.
+
+
+
+
+
+
+
+
+
+
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 181
+
+def parse_relationship ( assoc_name , assoc_data , options )
+ prefix_key = field_key ( assoc_name , options ) . to_s . singularize
+ hash =
+ if assoc_data . is_a? ( Array )
+ { " #{ prefix_key } _ids " . to_sym => assoc_data . map { | ri | ri [ ' id ' ] } }
+ else
+ { " #{ prefix_key } _id " . to_sym => assoc_data ? assoc_data [ ' id ' ] : nil }
+ end
+
+ polymorphic = ( options [ :polymorphic ] || [ ] ) . include? ( assoc_name . to_sym )
+ if polymorphic
+ hash [ " #{ prefix_key } _type " . to_sym ] = assoc_data . present? ? assoc_data [ ' type ' ] : nil
+ end
+
+ hash
+end
+
+
+
+
+
+
+
+
+ + (Object ) parse_relationships (relationships, options)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+199
+200
+201
+202
+203
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 199
+
+def parse_relationships ( relationships , options )
+ transform_keys ( relationships , options )
+ . map { | ( k , v ) | parse_relationship ( k , v [ ' data ' ] , options ) }
+ . reduce ( { } , :merge )
+end
+
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+206
+207
+208
+209
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 206
+
+def transform_keys ( hash , options )
+ transform = options [ :key_transform ] || :underscore
+ KeyTransform . send ( transform , hash )
+end
+
+
+
+
+
+
+
+
+ + (Object ) validate_payload (payload)
+
+
+
+
+
+
+
+
+ This method is part of a private API.
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
+
+
+
Checks whether a payload is compliant with the JSON API spec.
+
+
rubocop:disable Metrics/CyclomaticComplexity
+
+
+
+
+
+
+
+
+
+
+
+
+
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/deserialization.rb', line 110
+
+def validate_payload ( payload )
+ unless payload . is_a? ( Hash )
+ yield payload , ' Expected hash '
+ return
+ end
+
+ primary_data = payload [ ' data ' ]
+ unless primary_data . is_a? ( Hash )
+ yield payload , { data: ' Expected hash ' }
+ return
+ end
+
+ attributes = primary_data [ ' attributes ' ] || { }
+ unless attributes . is_a? ( Hash )
+ yield payload , { data: { attributes: ' Expected hash or nil ' } }
+ return
+ end
+
+ relationships = primary_data [ ' relationships ' ] || { }
+ unless relationships . is_a? ( Hash )
+ yield payload , { data: { relationships: ' Expected hash or nil ' } }
+ return
+ end
+
+ relationships . each do | ( key , value ) |
+ unless value . is_a? ( Hash ) && value . key? ( ' data ' )
+ yield payload , { data: { relationships: { key => ' Expected hash with :data key ' } } }
+ end
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/Error.html b/ActiveModelSerializers/Adapter/JsonApi/Error.html
new file mode 100644
index 00000000..7af45774
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/Error.html
@@ -0,0 +1,471 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter::JsonApi::Error
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter::JsonApi::Error
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/error.rb
+
+
+
+
+
+
Constant Summary
+
+
+
+ UnknownSourceTypeError =
+
+
+
+
rubocop:disable Style/AsciiComments
+
+
+
+
+
+
+
+
+
+ Class . new ( ArgumentError )
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) attribute_error_objects (attribute_name, attribute_errors)
+
+
+
+
+
+
+
+
+
definition:
+
+
JSON Object
+
+
+
properties:
+
+
☐ id : String
+☐ status : String
+☐ code : String
+☐ title : String
+☑ detail : String
+☐ links
+☐ meta
+☑ error_source
+
+
description:
+
+
id : A unique identifier for this particular occurrence of the problem.
+status : The HTTP status code applicable to this problem, expressed as a string value
+code : An application-specific error code, expressed as a string value.
+title : A short, human-readable summary of the problem. It **SHOULD NOT** change from
+ occurrence to occurrence of the problem, except for purposes of localization.
+detail : A human-readable explanation specific to this occurrence of the problem.
+
+
structure:
+
+
{
+ title: ' SystemFailure ' ,
+ detail: ' something went terribly wrong ' ,
+ status: ' 500 '
+} . merge! ( errorSource )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/error.rb', line 47
+
+def self . attribute_error_objects ( attribute_name , attribute_errors )
+ attribute_errors . map do | attribute_error |
+ {
+ source: error_source ( :pointer , attribute_name ) ,
+ detail: attribute_error
+ }
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) error_source (source_type, attribute_name)
+
+
+
+
+
+
+
+
+
errorSource description:
+
+
oneOf
+ ☑ pointer : String
+ ☑ parameter : String
+
+
description:
+
+
pointer: A JSON Pointer RFC6901 to the associated entity in the request document e.g. "/data"
+for a primary data object, or "/data/attributes/title" for a specific attribute.
+https://tools.ietf.org/html/rfc6901
+
+parameter: A string indicating which query parameter caused the error
+
+
structure:
+
+
if is_attribute?
+ {
+ pointer: ' /data/attributes/red-button '
+ }
+else
+ {
+ parameter: ' pres '
+ }
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/error.rb', line 78
+
+def self . error_source ( source_type , attribute_name )
+ case source_type
+ when :pointer
+ {
+ pointer: ActiveModelSerializers :: JsonPointer . new ( :attribute , attribute_name )
+ }
+ when :parameter
+ {
+ parameter: attribute_name
+ }
+ else
+ fail UnknownSourceTypeError , " Unknown source type ' #{ source_type } ' for attribute_name ' #{ attribute_name } ' "
+ end
+end
+
+
+
+
+
+
+
+
+ + (Array<Symbol, Array<String>> ) resource_errors (error_serializer, options)
+
+
+
+
+
+
+
+
+
+
+
+
+13
+14
+15
+16
+17
+18
+19
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/error.rb', line 13
+
+def self . resource_errors ( error_serializer , options )
+ error_serializer . as_json . flat_map do | attribute_name , attribute_errors |
+ attribute_name = JsonApi . send ( :transform_key_casing! , attribute_name ,
+ options )
+ attribute_error_objects ( attribute_name , attribute_errors )
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/Jsonapi.html b/ActiveModelSerializers/Adapter/JsonApi/Jsonapi.html
new file mode 100644
index 00000000..4b74de13
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/Jsonapi.html
@@ -0,0 +1,365 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter::JsonApi::Jsonapi
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Adapter::JsonApi::Jsonapi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/jsonapi.rb
+
+
+
+
+
Overview
+
+
+
toplevel_jsonapi definition:
+
+
JSON Object
+
+
+
properties:
+
+
version : String
+meta
+
+
description:
+
+
An object describing the server ' s implementation
+
+
structure:
+
+
{
+ version: ActiveModelSerializers . config . jsonapi_version ,
+ meta: ActiveModelSerializers . config . jsonapi_toplevel_meta
+} . reject! { | _ , v | v . blank? }
+
+
+
prs:
+
+
https :/ / github . com / rails - api / active_model_serializers / pull / 1050
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) add! (hash)
+
+
+
+
+
+
+
+
+
+
+
+26
+27
+28
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/jsonapi.rb', line 26
+
+def add! ( hash )
+ hash . merge! ( object ) if include_object?
+end
+
+
+
+
+
+
+
+
+ + (Boolean ) include_object?
+
+
+
+
+
+
+
+
+
+
+
+
+30
+31
+32
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/jsonapi.rb', line 30
+
+def include_object?
+ ActiveModelSerializers . config . jsonapi_include_toplevel_object
+end
+
+
+
+
+
+
+
+
+ + (Object ) object
+
+
+
+
+
+
+
+
+
TODO: see if we can cache this
+
+
+
+
+
+
+
+
+
+
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/jsonapi.rb', line 35
+
+def object
+ object = {
+ jsonapi: {
+ version: ActiveModelSerializers . config . jsonapi_version ,
+ meta: ActiveModelSerializers . config . jsonapi_toplevel_meta
+ }
+ }
+ object [ :jsonapi ] . reject! { | _ , v | v . blank? }
+
+ object
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/Link.html b/ActiveModelSerializers/Adapter/JsonApi/Link.html
new file mode 100644
index 00000000..44a6a5f7
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/Link.html
@@ -0,0 +1,475 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::Link
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::Link
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Adapter::JsonApi::Link
+
+
+ show all
+
+
+
+
+
+
+
+
+ Includes:
+ SerializationContext::UrlHelpers
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/link.rb
+
+
+
+
+
Overview
+
+
+
link definition:
+
+
oneOf
+ linkString
+ linkObject
+
+
+
description:
+
+
A link **MUST** be represented as either: a string containing the link's URL or a link
+object."
+
+
structure:
+
+
if href?
+ linkString
+else
+ linkObject
+end
+
+
+
linkString definition:
+
+
URI
+
+
+
description:
+
+
A string containing the link ' s URL.
+
+
structure:
+
+
' http://example.com/link-string '
+
+
+
linkObject definition:
+
+
JSON Object
+
+
+
properties:
+
+
href (required) : URI
+meta
+
+
structure:
+
+
{
+ href: ' http://example.com/link-object ' ,
+ meta: meta ,
+} . reject! { | _ , v | v . nil? }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#default_url_options , included
+
+
Constructor Details
+
+
+
+
+ - (Link ) initialize (serializer, value)
+
+
+
+
+
+
+
+
+
Returns a new instance of Link
+
+
+
+
+
+
+
+
+
+
+
+
+
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/link.rb', line 44
+
+def initialize ( serializer , value )
+ @_routes ||= nil @object = serializer . object
+ @scope = serializer . scope
+ if value . respond_to? ( :call )
+ @value = instance_eval ( & value )
+ else
+ @value = value
+ end
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) as_json
+
+
+
+
+
+
+
+
+
+
+
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/link.rb', line 67
+
+def as_json
+ return @value if @value
+
+ hash = { }
+ hash [ :href ] = @href if defined? ( @href )
+ hash [ :meta ] = @meta if defined? ( @meta )
+
+ hash . any? ? hash : nil
+end
+
+
+
+
+
+
+
+
+ - (Object ) href (value)
+
+
+
+
+
+
+
+
+
+
+
+57
+58
+59
+60
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/link.rb', line 57
+
+def href ( value )
+ @href = value
+ nil
+end
+
+
+
+
+
+
+
+
+
+
+
+
+62
+63
+64
+65
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/link.rb', line 62
+
+def meta ( value )
+ @meta = value
+ nil
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/Meta.html b/ActiveModelSerializers/Adapter/JsonApi/Meta.html
new file mode 100644
index 00000000..ea290d96
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/Meta.html
@@ -0,0 +1,301 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::Meta
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::Meta
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Adapter::JsonApi::Meta
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/meta.rb
+
+
+
+
+
Overview
+
+
+
meta definition:
+
+
JSON Object
+
+
+
description:
+
+
Non-standard meta-information that can not be represented as an attribute or relationship.
+
+
structure:
+
+
{
+ attitude: ' adjustable '
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (Meta ) initialize (serializer)
+
+
+
+
+
+
+
+
+
Returns a new instance of Meta
+
+
+
+
+
+
+
+
+
+
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/meta.rb', line 15
+
+def initialize ( serializer )
+ @object = serializer . object
+ @scope = serializer . scope
+
+ if serializer . _meta . respond_to? ( :call )
+ @value = instance_eval ( & serializer . _meta )
+ else
+ @value = serializer . _meta
+ end
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) as_json
+
+
+
+
+
+
+
+
+
+
+
+27
+28
+29
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/meta.rb', line 27
+
+def as_json
+ @value
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/PaginationLinks.html b/ActiveModelSerializers/Adapter/JsonApi/PaginationLinks.html
new file mode 100644
index 00000000..fd2b17f0
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/PaginationLinks.html
@@ -0,0 +1,440 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::PaginationLinks
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::PaginationLinks
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Adapter::JsonApi::PaginationLinks
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/pagination_links.rb
+
+
+
+
+
+
Constant Summary
+
+
+
+ FIRST_PAGE =
+
+
+ 1
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) collection
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute collection.
+
+
+
+
+
+
+
+
+ - (Object) context
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute context.
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (PaginationLinks ) initialize (collection, adapter_options)
+
+
+
+
+
+
+
+
+
Returns a new instance of PaginationLinks
+
+
+
+
+
+
+
+
+
+
+
+
+
+9
+10
+11
+12
+13
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 9
+
+def initialize ( collection , adapter_options )
+ @collection = collection
+ @adapter_options = adapter_options
+ @context = adapter_options . fetch ( :serialization_context )
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) collection
+
+
+
+
+
+
+
+
+
Returns the value of attribute collection
+
+
+
+
+
+
+
+
+
+
+
+
+
+7
+8
+9
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 7
+
+def collection
+ @collection
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) context
+
+
+
+
+
+
+
+
+
Returns the value of attribute context
+
+
+
+
+
+
+
+
+
+
+
+
+
+7
+8
+9
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 7
+
+def context
+ @context
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) as_json
+
+
+
+
+
+
+
+
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/pagination_links.rb', line 15
+
+def as_json
+ per_page = collection . try ( :per_page ) || collection . try ( :limit_value ) || collection . size
+ pages_from . each_with_object ( { } ) do | ( key , value ) , hash |
+ params = query_parameters . merge ( page: { number: value , size: per_page } ) . to_query
+
+ hash [ key ] = " #{ url ( adapter_options ) } ? #{ params } "
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/Relationship.html b/ActiveModelSerializers/Adapter/JsonApi/Relationship.html
new file mode 100644
index 00000000..284cb3a3
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/Relationship.html
@@ -0,0 +1,296 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::Relationship
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::Relationship
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Adapter::JsonApi::Relationship
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/relationship.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (Relationship ) initialize (parent_serializer, serializer, serializable_resource_options, args = {})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/relationship.rb', line 9
+
+def initialize ( parent_serializer , serializer , serializable_resource_options , args = { } )
+ @object = parent_serializer . object
+ @scope = parent_serializer . scope
+ @association_options = args . fetch ( :options , { } )
+ @serializable_resource_options = serializable_resource_options
+ @data = data_for ( serializer )
+ @links = args . fetch ( :links , { } ) . each_with_object ( { } ) do | ( key , value ) , hash |
+ hash [ key ] = ActiveModelSerializers :: Adapter :: JsonApi :: Link . new ( parent_serializer , value ) . as_json
+ end
+ meta = args . fetch ( :meta , nil )
+ @meta = meta . respond_to? ( :call ) ? parent_serializer . instance_eval ( & meta ) : meta
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) as_json
+
+
+
+
+
+
+
+
+
+
+
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/relationship.rb', line 22
+
+def as_json
+ hash = { }
+ hash [ :data ] = data if association_options [ :include_data ]
+ links = self . links
+ hash [ :links ] = links if links . any?
+ meta = self . meta
+ hash [ :meta ] = meta if meta
+
+ hash
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/JsonApi/ResourceIdentifier.html b/ActiveModelSerializers/Adapter/JsonApi/ResourceIdentifier.html
new file mode 100644
index 00000000..863e0099
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/JsonApi/ResourceIdentifier.html
@@ -0,0 +1,264 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Adapter::JsonApi::ResourceIdentifier
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/json_api/resource_identifier.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (ResourceIdentifier ) initialize (serializer, options)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6
+7
+8
+9
+10
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/resource_identifier.rb', line 6
+
+def initialize ( serializer , options )
+ @id = id_for ( serializer )
+ @type = JsonApi . send ( :transform_key_casing! , type_for ( serializer ) ,
+ options )
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) as_json
+
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+
+
+ # File 'lib/active_model_serializers/adapter/json_api/resource_identifier.rb', line 12
+
+def as_json
+ { id: id , type: type }
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Adapter/Null.html b/ActiveModelSerializers/Adapter/Null.html
new file mode 100644
index 00000000..3c00620f
--- /dev/null
+++ b/ActiveModelSerializers/Adapter/Null.html
@@ -0,0 +1,217 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Null
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Adapter::Null
+
+
+
+
+
+
+
+ Inherits:
+
+ Base
+
+
+ Object
+
+ Base
+
+ ActiveModelSerializers::Adapter::Null
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/adapter/null.rb
+
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from Base
+
#instance_options , #serializer
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods inherited from Base
+
#as_json , cache_key , #cache_key , default_key_transform , #fragment_cache , fragment_cache , inherited , #initialize , transform , transform_key_casing!
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) serializable_hash
+
+
+
+
+
+
+
+
+
+
+
+4
+5
+6
+
+
+ # File 'lib/active_model_serializers/adapter/null.rb', line 4
+
+def serializable_hash ( * )
+ { }
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Callbacks.html b/ActiveModelSerializers/Callbacks.html
new file mode 100644
index 00000000..2fe6c73a
--- /dev/null
+++ b/ActiveModelSerializers/Callbacks.html
@@ -0,0 +1,142 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Callbacks
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Callbacks
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+ Includes:
+ ActiveSupport::Callbacks
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/callbacks.rb
+
+
+
+
+
Overview
+
+
+
ActiveModelSerializers Callbacks
+
+
ActiveModelSerializers provides hooks during the life cycle of
+serialization and allow you to trigger logic. Available callbacks are:
+
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Callbacks/ClassMethods.html b/ActiveModelSerializers/Callbacks/ClassMethods.html
new file mode 100644
index 00000000..e5f14f46
--- /dev/null
+++ b/ActiveModelSerializers/Callbacks/ClassMethods.html
@@ -0,0 +1,225 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Callbacks::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Callbacks::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/callbacks.rb
+
+
+
+
+
Overview
+
+
+
These methods will be included into any ActiveModelSerializers object,
+adding callbacks for render.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+ - (Object) around_render (*filters, &blk)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Defines a callback that will get called around the render method, whether
+it is as_json, to_json, or serializable_hash.
+
+
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) around_render (*filters, &blk)
+
+
+
+
+
+
+
+
+
Defines a callback that will get called around the render method, whether
+it is as_json, to_json, or serializable_hash
+
+
class ActiveModelSerializers :: SerializableResource
+ include ActiveModelSerializers :: Callbacks
+
+ around_render do | args , block |
+ tag_logger do
+ notify_render do
+ block . call ( args )
+ end
+ end
+ end
+
+ def as_json
+ run_callbacks :render do
+ adapter . as_json
+ end
+ end
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+50
+51
+52
+
+
+ # File 'lib/active_model_serializers/callbacks.rb', line 50
+
+def around_render ( * filters , & blk )
+ set_callback ( :render , :around , * filters , & blk )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Deprecate.html b/ActiveModelSerializers/Deprecate.html
new file mode 100644
index 00000000..1335fe65
--- /dev/null
+++ b/ActiveModelSerializers/Deprecate.html
@@ -0,0 +1,271 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Deprecate
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Deprecate
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Included in:
+ ActiveModel::SerializableResource , ActiveModel::Serializer , ActiveModel::Serializer::Adapter , ActiveModel::Serializer::Adapter::Attributes , ActiveModel::Serializer::Adapter::Base , ActiveModel::Serializer::Adapter::Json , ActiveModel::Serializer::Adapter::JsonApi , ActiveModel::Serializer::Adapter::Null , ActiveModel::Serializer::ArraySerializer
+
+
+
+ Defined in:
+ lib/active_model_serializers/deprecate.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) delegate_and_deprecate (method, delegee)
+
+
+
+
+
+
+
+
+
+
+
+46
+47
+48
+49
+
+
+ # File 'lib/active_model_serializers/deprecate.rb', line 46
+
+def delegate_and_deprecate ( method , delegee )
+ delegate method , to: delegee
+ deprecate method , " #{ delegee . name } . "
+end
+
+
+
+
+
+
+
+
+ + (Object ) deprecate (name, replacement)
+
+
+
+
+
+
+
+
+
Simple deprecation method that deprecates name by wrapping it
+up in a dummy method. It warns on each call to the dummy method telling the
+user of replacement (unless replacement is :none)
+that it is planned to go away.
+
+
+
+
+
+
+
+
+
+
+
+
+
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
+
+ # File 'lib/active_model_serializers/deprecate.rb', line 31
+
+def deprecate ( name , replacement )
+ old = " _deprecated_ #{ name } "
+ alias_method old , name
+ class_eval do
+ define_method ( name ) do | * args , & block |
+ target = is_a? ( Module ) ? " #{ self } . " : " #{ self . class } # "
+ msg = [ " NOTE: #{ target } #{ name } is deprecated " ,
+ replacement == :none ? ' with no replacement ' : " ; use #{ replacement } instead " ,
+ " \n #{ target } #{ name } called from #{ ActiveModelSerializers . location_of_caller . join ( " : " ) } " ]
+ warn " #{ msg . join } . "
+ send old , * args , & block
+ end
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Deserialization.html b/ActiveModelSerializers/Deserialization.html
new file mode 100644
index 00000000..2146da32
--- /dev/null
+++ b/ActiveModelSerializers/Deserialization.html
@@ -0,0 +1,239 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Deserialization
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Deserialization
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/deserialization.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) jsonapi_parse (*args)
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model_serializers/deserialization.rb', line 5
+
+def jsonapi_parse ( * args )
+ Adapter :: JsonApi :: Deserialization . parse ( * args )
+end
+
+
+
+
+
+
+
+
+ + (Object ) jsonapi_parse! (*args)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10
+11
+12
+
+
+ # File 'lib/active_model_serializers/deserialization.rb', line 10
+
+def jsonapi_parse! ( * args )
+ Adapter :: JsonApi :: Deserialization . parse! ( * args )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/JsonPointer.html b/ActiveModelSerializers/JsonPointer.html
new file mode 100644
index 00000000..24ce5e46
--- /dev/null
+++ b/ActiveModelSerializers/JsonPointer.html
@@ -0,0 +1,189 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::JsonPointer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::JsonPointer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/json_pointer.rb
+
+
+
+
+
+
Constant Summary
+
+
+
+ POINTERS =
+
+
+ {
+ attribute: ' /data/attributes/%s ' . freeze ,
+ primary_data: ' /data%s ' . freeze
+} . freeze
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) new (pointer_type, value = nil)
+
+
+
+
+
+
+
+
+
+
+
+10
+11
+12
+
+
+ # File 'lib/active_model_serializers/json_pointer.rb', line 10
+
+def new ( pointer_type , value = nil )
+ format ( POINTERS [ pointer_type ] , value )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Jsonapi.html b/ActiveModelSerializers/Jsonapi.html
new file mode 100644
index 00000000..30cd6e5c
--- /dev/null
+++ b/ActiveModelSerializers/Jsonapi.html
@@ -0,0 +1,352 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Jsonapi
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Jsonapi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/register_jsonapi_renderer.rb
+
+
+
+
+
Overview
+
+
+
Based on discussion in github.com/rails/rails/pull/23712#issuecomment-184977238 ,
+the JSON API media type will have its own format/renderer.
+
+
> We recommend the media type be registered on its own as jsonapi when a
+jsonapi Renderer and deserializer (Http::Parameters::DEFAULT_PARSERS) are
+added.
+
+
Usage:
+
+
ActiveSupport.on_load(:action_controller) do
+
+
require ' active_model_serializers/register_jsonapi_renderer '
+
+
+
end
+
+
And then in controllers, use `render jsonapi: model` rather than `render
+json: model, adapter: :json_api`.
+
+
For example, in a controller action, we can: respond_to do |format|
+
+
format . jsonapi { render jsonapi: model }
+
+
+
end
+
+
or
+
+
render jsonapi: model
+
+
No wrapper format needed as it does not apply (i.e. no `wrap_parameters
+format: [jsonapi]`)
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ControllerSupport
+
+
+
+
+
+
+
Constant Summary
+
+
+
+ MEDIA_TYPE =
+
+
+ ' application/vnd.api+json ' . freeze
+
+
+ {
+ response: { ' CONTENT_TYPE ' . freeze => MEDIA_TYPE } ,
+ request: { ' ACCEPT ' . freeze => MEDIA_TYPE }
+} . freeze
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+ + (Object) install
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + (Object) parser
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Proposal: should actually deserialize the JSON API params to the hash
+format expected by `ActiveModel::Serializers::JSON`
+actionpack/lib/action_dispatch/http/parameters.rb.
+
+
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) install
+
+
+
+
+
+
+
+
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
+
+ # File 'lib/active_model_serializers/register_jsonapi_renderer.rb', line 32
+
+def self . install
+ Mime :: Type . register MEDIA_TYPE , :jsonapi
+
+ if Rails :: VERSION :: MAJOR >= 5
+ ActionDispatch :: Request . parameter_parsers [ :jsonapi ] = parser
+ else
+ ActionDispatch :: ParamsParser :: DEFAULT_PARSERS [ Mime [ :jsonapi ] ] = parser
+ end
+
+ ActionController :: Renderers . add :jsonapi do | json , options |
+ json = serialize_jsonapi ( json , options ) . to_json ( options ) unless json . is_a? ( String )
+ self . content_type ||= Mime [ :jsonapi ]
+ self . response_body = json
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) parser
+
+
+
+
+
+
+
+
+
Proposal: should actually deserialize the JSON API params to the hash
+format expected by `ActiveModel::Serializers::JSON`
+actionpack/lib/action_dispatch/http/parameters.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+53
+54
+55
+56
+57
+58
+59
+
+
+ # File 'lib/active_model_serializers/register_jsonapi_renderer.rb', line 53
+
+def self . parser
+ lambda do | body |
+ data = JSON . parse ( body )
+ data = { :_json => data } unless data . is_a? ( Hash )
+ data . with_indifferent_access
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Jsonapi/ControllerSupport.html b/ActiveModelSerializers/Jsonapi/ControllerSupport.html
new file mode 100644
index 00000000..ff8f3e85
--- /dev/null
+++ b/ActiveModelSerializers/Jsonapi/ControllerSupport.html
@@ -0,0 +1,182 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Jsonapi::ControllerSupport
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Jsonapi::ControllerSupport
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/register_jsonapi_renderer.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) serialize_jsonapi (json, options)
+
+
+
+
+
+
+
+
+
+
+
+62
+63
+64
+65
+66
+67
+68
+
+
+ # File 'lib/active_model_serializers/register_jsonapi_renderer.rb', line 62
+
+def serialize_jsonapi ( json , options )
+ options [ :adapter ] = :json_api
+ options . fetch ( :serialization_context ) do
+ options [ :serialization_context ] = ActiveModelSerializers :: SerializationContext . new ( request )
+ end
+ get_serializer ( json , options )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/KeyTransform.html b/ActiveModelSerializers/KeyTransform.html
new file mode 100644
index 00000000..c8b0c801
--- /dev/null
+++ b/ActiveModelSerializers/KeyTransform.html
@@ -0,0 +1,533 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::KeyTransform
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::KeyTransform
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/key_transform.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) camel (value)
+
+
+
+
+
+
+
+
+
Transforms values to UpperCamelCase or PascalCase.
+
+
@example:
+
+
"some_key" => "SomeKey",
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+15
+16
+17
+18
+19
+
+
+ # File 'lib/active_model_serializers/key_transform.rb', line 12
+
+def camel ( value )
+ case value
+ when Hash then value . deep_transform_keys! { | key | camel ( key ) }
+ when Symbol then camel ( value . to_s ) . to_sym
+ when String then value . underscore . camelize
+ else value
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) camel_lower (value)
+
+
+
+
+
+
+
+
+
Transforms values to camelCase.
+
+
@example:
+
+
"some_key" => "someKey",
+
+
+
+
+
+
+
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+
+
+ # File 'lib/active_model_serializers/key_transform.rb', line 26
+
+def camel_lower ( value )
+ case value
+ when Hash then value . deep_transform_keys! { | key | camel_lower ( key ) }
+ when Symbol then camel_lower ( value . to_s ) . to_sym
+ when String then value . underscore . camelize ( :lower )
+ else value
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) dash (value)
+
+
+
+
+
+
+
+
+
Transforms values to dashed-case. This is the default case for the JsonApi
+adapter.
+
+
@example:
+
+
"some_key" => "some-key",
+
+
+
+
+
+
+
+
+
+
+41
+42
+43
+44
+45
+46
+47
+48
+
+
+ # File 'lib/active_model_serializers/key_transform.rb', line 41
+
+def dash ( value )
+ case value
+ when Hash then value . deep_transform_keys! { | key | dash ( key ) }
+ when Symbol then dash ( value . to_s ) . to_sym
+ when String then value . underscore . dasherize
+ else value
+ end
+end
+
+
+
+
+
+
+
+
+ + (Object ) unaltered (value)
+
+
+
+
+
+
+
+
+
Returns the value unaltered
+
+
+
+
+
+
+
+
+
+
+
+
+
+66
+67
+68
+
+
+ # File 'lib/active_model_serializers/key_transform.rb', line 66
+
+def unaltered ( value )
+ value
+end
+
+
+
+
+
+
+
+
+ + (Object ) underscore (value)
+
+
+
+
+
+
+
+
+
Transforms values to underscore_case. This is the default case for
+deserialization in the JsonApi adapter.
+
+
@example:
+
+
"some-key" => "some_key",
+
+
+
+
+
+
+
+
+
+
+56
+57
+58
+59
+60
+61
+62
+63
+
+
+ # File 'lib/active_model_serializers/key_transform.rb', line 56
+
+def underscore ( value )
+ case value
+ when Hash then value . deep_transform_keys! { | key | underscore ( key ) }
+ when Symbol then underscore ( value . to_s ) . to_sym
+ when String then value . underscore
+ else value
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Logging.html b/ActiveModelSerializers/Logging.html
new file mode 100644
index 00000000..a985b01f
--- /dev/null
+++ b/ActiveModelSerializers/Logging.html
@@ -0,0 +1,271 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Logging
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Logging
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+ Included in:
+ SerializableResource
+
+
+
+ Defined in:
+ lib/active_model_serializers/logging.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ClassMethods , Macros
+
+
+
+ Classes: LogSubscriber
+
+
+
+
+
Constant Summary
+
+
+
+ RENDER_EVENT =
+
+
+ ' render.active_model_serializers ' . freeze
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) notify_render
+
+
+
+
+
+
+
+
+
+
+
+76
+77
+78
+79
+80
+81
+
+
+ # File 'lib/active_model_serializers/logging.rb', line 76
+
+def notify_render ( * )
+ event_name = RENDER_EVENT
+ ActiveSupport :: Notifications . instrument ( event_name , notify_render_payload ) do
+ yield
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) notify_render_payload
+
+
+
+
+
+
+
+
+
+
+
+83
+84
+85
+86
+87
+88
+
+
+ # File 'lib/active_model_serializers/logging.rb', line 83
+
+def notify_render_payload
+ {
+ serializer: serializer || ActiveModel :: Serializer :: Null ,
+ adapter: adapter || ActiveModelSerializers :: Adapter :: Null
+ }
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Logging/ClassMethods.html b/ActiveModelSerializers/Logging/ClassMethods.html
new file mode 100644
index 00000000..75a70892
--- /dev/null
+++ b/ActiveModelSerializers/Logging/ClassMethods.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Logging::ClassMethods
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Logging::ClassMethods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/logging.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) instrument_rendering
+
+
+
+
+
+
+
+
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
+ # File 'lib/active_model_serializers/logging.rb', line 18
+
+def instrument_rendering
+ around_render do | args , block |
+ tag_logger do
+ notify_render do
+ block . call ( args )
+ end
+ end
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Logging/LogSubscriber.html b/ActiveModelSerializers/Logging/LogSubscriber.html
new file mode 100644
index 00000000..be7d0673
--- /dev/null
+++ b/ActiveModelSerializers/Logging/LogSubscriber.html
@@ -0,0 +1,254 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Logging::LogSubscriber
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Logging::LogSubscriber
+
+
+
+
+
+
+
+ Inherits:
+
+ ActiveSupport::LogSubscriber
+
+
+ Object
+
+ ActiveSupport::LogSubscriber
+
+ ActiveModelSerializers::Logging::LogSubscriber
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/logging.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) logger
+
+
+
+
+
+
+
+
+
+
+
+115
+116
+117
+
+
+ # File 'lib/active_model_serializers/logging.rb', line 115
+
+def logger
+ ActiveModelSerializers . logger
+end
+
+
+
+
+
+
+
+
+ - (Object ) render (event)
+
+
+
+
+
+
+
+
+
+
+
+106
+107
+108
+109
+110
+111
+112
+113
+
+
+ # File 'lib/active_model_serializers/logging.rb', line 106
+
+def render ( event )
+ info do
+ serializer = event . payload [ :serializer ]
+ adapter = event . payload [ :adapter ]
+ duration = event . duration . round ( 2 )
+ " Rendered #{ serializer . name } with #{ adapter . class } ( #{ duration } ms) "
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Logging/Macros.html b/ActiveModelSerializers/Logging/Macros.html
new file mode 100644
index 00000000..79efbd98
--- /dev/null
+++ b/ActiveModelSerializers/Logging/Macros.html
@@ -0,0 +1,249 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Logging::Macros
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Logging::Macros
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/logging.rb
+
+
+
+
+
Overview
+
+
+
Macros that can be used to customize the logging of class or instance
+methods, by extending the class or its singleton.
+
+
Adapted from:
+
+
https :/ / github . com / rubygems / rubygems / blob / cb28f5e991 / lib / rubygems / deprecate . rb
+
+
+
Provides a single method notify to be used to declare when
+something a method notifies, with the argument callback_name
+of the notification callback.
+
+
class Adapter
+ def self . klass_method
+ end
+
+ def instance_method
+ end
+
+ include ActiveModelSerializers :: Logging :: Macros
+ notify :instance_method , :render
+
+ class << self
+ extend ActiveModelSerializers :: Logging :: Macros
+ notify :klass_method , :render
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) notify (name, callback_name)
+
+
+
+
+
+
+
+
+
Simple notify method that wraps up name in a dummy method. It
+notifies on with the callback_name notifier on each call to
+the dummy method, telling what the current serializer and adapter are being
+rendered. Adapted from:
+
+
https :/ / github . com / rubygems / rubygems / blob / cb28f5e991 / lib / rubygems / deprecate . rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
+
+ # File 'lib/active_model_serializers/logging.rb', line 63
+
+def notify ( name , callback_name )
+ class_eval do
+ old = " _notifying_ #{ callback_name } _ #{ name } "
+ alias_method old , name
+ define_method name do | * args , & block |
+ run_callbacks callback_name do
+ send old , * args , & block
+ end
+ end
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Model.html b/ActiveModelSerializers/Model.html
new file mode 100644
index 00000000..8c1b3d99
--- /dev/null
+++ b/ActiveModelSerializers/Model.html
@@ -0,0 +1,761 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Model
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Model
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Model
+
+
+ show all
+
+
+
+
+
+
+
+
+ Includes:
+ ActiveModel::Model, ActiveModel::Serializers::JSON
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/model.rb
+
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) attributes
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute attributes.
+
+
+
+
+
+
+
+
+ - (Object) errors
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute errors.
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (Model ) initialize (attributes = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of Model
+
+
+
+
+
+
+
+
+
+
+
+
+
+11
+12
+13
+14
+15
+
+
+ # File 'lib/active_model_serializers/model.rb', line 11
+
+def initialize ( attributes = { } )
+ @attributes = attributes
+ @errors = ActiveModel :: Errors . new ( self )
+ super
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) attributes
+
+
+
+
+
+
+
+
+
Returns the value of attribute attributes
+
+
+
+
+
+
+
+
+
+
+
+
+
+9
+10
+11
+
+
+ # File 'lib/active_model_serializers/model.rb', line 9
+
+def attributes
+ @attributes
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) errors
+
+
+
+
+
+
+
+
+
Returns the value of attribute errors
+
+
+
+
+
+
+
+
+
+
+
+
+
+9
+10
+11
+
+
+ # File 'lib/active_model_serializers/model.rb', line 9
+
+def errors
+ @errors
+end
+
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) human_attribute_name (attr, _options = {})
+
+
+
+
+
+
+
+
+
The following methods are needed to be minimally implemented for
+ActiveModel::Errors :nocov:
+
+
+
+
+
+
+
+
+
+
+
+
+
+42
+43
+44
+
+
+ # File 'lib/active_model_serializers/model.rb', line 42
+
+def self . human_attribute_name ( attr , _options = { } )
+ attr
+end
+
+
+
+
+
+
+
+
+ + (Object ) lookup_ancestors
+
+
+
+
+
+
+
+
+
+
+
+46
+47
+48
+
+
+ # File 'lib/active_model_serializers/model.rb', line 46
+
+def self . lookup_ancestors
+ [ self ]
+end
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) cache_key
+
+
+
+
+
+
+
+
+
Defaults to the downcased model name and updated_at
+
+
+
+
+
+
+
+
+
+
+
+
+
+23
+24
+25
+
+
+ # File 'lib/active_model_serializers/model.rb', line 23
+
+def cache_key
+ attributes . fetch ( :cache_key ) { " #{ self . class . name . downcase } / #{ id } - #{ updated_at . strftime ( " %Y%m%d%H%M%S%9N " ) } " }
+end
+
+
+
+
+
+
+
+
+ - (Object ) id
+
+
+
+
+
+
+
+
+
Defaults to the downcased model name.
+
+
+
+
+
+
+
+
+
+
+
+
+
+18
+19
+20
+
+
+ # File 'lib/active_model_serializers/model.rb', line 18
+
+def id
+ attributes . fetch ( :id ) { self . class . name . downcase }
+end
+
+
+
+
+
+
+
+
+ - (Object ) read_attribute_for_serialization (key)
+
+
+
+
+
+
+
+
+
+
+
+32
+33
+34
+35
+36
+37
+38
+
+
+ # File 'lib/active_model_serializers/model.rb', line 32
+
+def read_attribute_for_serialization ( key )
+ if key == :id || key == ' id '
+ attributes . fetch ( key ) { id }
+ else
+ attributes [ key ]
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) updated_at
+
+
+
+
+
+
+
+
+
Defaults to the time the serializer file was modified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+28
+29
+30
+
+
+ # File 'lib/active_model_serializers/model.rb', line 28
+
+def updated_at
+ attributes . fetch ( :updated_at ) { File . mtime ( __FILE__ ) }
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Railtie.html b/ActiveModelSerializers/Railtie.html
new file mode 100644
index 00000000..e4391993
--- /dev/null
+++ b/ActiveModelSerializers/Railtie.html
@@ -0,0 +1,123 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Railtie
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Railtie
+
+
+
+
+
+
+
+ Inherits:
+
+ Rails::Railtie
+
+
+ Object
+
+ Rails::Railtie
+
+ ActiveModelSerializers::Railtie
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/railtie.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/SerializableResource.html b/ActiveModelSerializers/SerializableResource.html
new file mode 100644
index 00000000..aba884e8
--- /dev/null
+++ b/ActiveModelSerializers/SerializableResource.html
@@ -0,0 +1,831 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::SerializableResource
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::SerializableResource
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::SerializableResource
+
+
+ show all
+
+
+
+
+
+
+
+
+ Includes:
+ Logging
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/serializable_resource.rb
+
+
+
+
+
+
Constant Summary
+
+
+
+ ADAPTER_OPTION_KEYS =
+
+
+ Set . new ( [ :include , :fields , :adapter , :meta , :meta_key , :links , :serialization_context , :key_transform ] )
+
+
+
+
+
+
+
+
+
Constants included
+ from Logging
+
Logging::RENDER_EVENT
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods included from Logging
+
#notify_render , #notify_render_payload
+
+
+
Constructor Details
+
+
+
+
+ - (Object ) initialize (resource, options = {})
+
+
+
+
+
+
+
+
+
Primary interface to composing a resource with a serializer and adapter.
+
+
+
+
+
+
+
+
+
+
+
+
+
+15
+16
+17
+18
+19
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 15
+
+def initialize ( resource , options = { } )
+ @resource = resource
+ @adapter_opts , @serializer_opts =
+ options . partition { | k , _ | ADAPTER_OPTION_KEYS . include? k } . map { | h | Hash [ h ] }
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) adapter
+
+
+
+ Also known as:
+ adapter_instance
+
+
+
+
+
+
+
+
NOTE: if no adapter is available, returns the resource itself. (i.e.
+adapter is a no-op)
+
+
+
+
+
+
+
+
+
+
+
+
+
+34
+35
+36
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 34
+
+def adapter
+ @adapter ||= find_adapter
+end
+
+
+
+
+
+
+
+
+ - (Object ) find_adapter
+
+
+
+
+
+
+
+
+
+
+
+39
+40
+41
+42
+43
+44
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 39
+
+def find_adapter
+ return resource unless serializer?
+ ActiveModelSerializers :: Adapter . create ( serializer_instance , adapter_opts )
+rescue ActiveModel :: Serializer :: CollectionSerializer :: NoSerializerError
+ resource
+end
+
+
+
+
+
+
+
+
+ - (Object ) serialization_scope
+
+
+
+
+
+
+
+
+
+
+
+25
+26
+27
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 25
+
+def serialization_scope
+ serializer_opts [ :scope ]
+end
+
+
+
+
+
+
+
+
+ - (Object ) serialization_scope= (scope)
+
+
+
+
+
+
+
+
+
+
+
+21
+22
+23
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 21
+
+def serialization_scope= ( scope )
+ serializer_opts [ :scope ] = scope
+end
+
+
+
+
+
+
+
+
+ - (Object ) serialization_scope_name= (scope_name)
+
+
+
+
+
+
+
+
+
+
+
+29
+30
+31
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 29
+
+def serialization_scope_name= ( scope_name )
+ serializer_opts [ :scope_name ] = scope_name
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializer
+
+
+
+ Also known as:
+ serializer_class
+
+
+
+
+
+
+
+
Get serializer either explicitly :serializer or implicitly from resource
+Remove :serializer key from serializer_opts Replace :serializer key with
+:each_serializer if present
+
+
+
+
+
+
+
+
+
+
+
+
+
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 53
+
+def serializer
+ @serializer ||=
+ begin
+ @serializer = serializer_opts . delete ( :serializer )
+ @serializer ||= ActiveModel :: Serializer . serializer_for ( resource )
+
+ if serializer_opts . key? ( :each_serializer )
+ serializer_opts [ :serializer ] = serializer_opts . delete ( :each_serializer )
+ end
+ @serializer
+ end
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) serializer?
+
+
+
+
+
+
+
+
+
+
+
+
+73
+74
+75
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 73
+
+def serializer?
+ use_adapter? && ! serializer . nil?
+end
+
+
+
+
+
+
+
+
+ - (Object ) serializer_instance
+
+
+
+
+
+
+
+
+
+
+
+46
+47
+48
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 46
+
+def serializer_instance
+ @serializer_instance ||= serializer . new ( resource , serializer_opts )
+end
+
+
+
+
+
+
+
+
+ - (Boolean ) use_adapter?
+
+
+
+
+
+
+
+
+
True when no explicit adapter given, or explicit appear is truthy (non-nil)
+False when explicit adapter is falsy (nil or false)
+
+
+
+
+
+
+
+
+
+
+69
+70
+71
+
+
+ # File 'lib/active_model_serializers/serializable_resource.rb', line 69
+
+def use_adapter?
+ ! ( adapter_opts . key? ( :adapter ) && ! adapter_opts [ :adapter ] )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/SerializationContext.html b/ActiveModelSerializers/SerializationContext.html
new file mode 100644
index 00000000..8e773d4f
--- /dev/null
+++ b/ActiveModelSerializers/SerializationContext.html
@@ -0,0 +1,568 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::SerializationContext
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::SerializationContext
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::SerializationContext
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/serialization_context.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: UrlHelpers
+
+
+
+
+
+
+
+
+
+
Class Attribute Summary (collapse )
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) key_transform
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute key_transform.
+
+
+
+
+
+
+
+
+ - (Object) query_parameters
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute query_parameters.
+
+
+
+
+
+
+
+
+ - (Object) request_url
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute request_url.
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (SerializationContext ) initialize (request, options = {})
+
+
+
+
+
+
+
+
+
Returns a new instance of SerializationContext
+
+
+
+
+
+
+
+
+
+
+
+
+
+25
+26
+27
+28
+29
+30
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 25
+
+def initialize ( request , options = { } )
+ @request_url = request . original_url [ / \A[^?]+ / ]
+ @query_parameters = request . query_parameters
+ @url_helpers = options . delete ( :url_helpers ) || self . class . url_helpers
+ @default_url_options = options . delete ( :default_url_options ) || self . class . default_url_options
+end
+
+
+
+
+
+
+
+
+
Class Attribute Details
+
+
+
+
+
+
+ + (Object ) default_url_options
+
+
+
+
+
+
+
+
+
+
+
+9
+10
+11
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 9
+
+def default_url_options
+ @default_url_options ||= { }
+end
+
+
+
+
+
+
+
+
+
+
+ + (Object ) url_helpers
+
+
+
+
+
+
+
+
+
+
+
+5
+6
+7
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 5
+
+def url_helpers
+ @url_helpers ||= Module . new
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+
+
Returns the value of attribute key_transform
+
+
+
+
+
+
+
+
+
+
+
+
+
+23
+24
+25
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 23
+
+def key_transform
+ @key_transform
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) query_parameters
+
+
+
+
+
+
+
+
+
Returns the value of attribute query_parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+23
+24
+25
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 23
+
+def query_parameters
+ @query_parameters
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) request_url
+
+
+
+
+
+
+
+
+
Returns the value of attribute request_url
+
+
+
+
+
+
+
+
+
+
+
+
+
+23
+24
+25
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 23
+
+def request_url
+ @request_url
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/SerializationContext/UrlHelpers.html b/ActiveModelSerializers/SerializationContext/UrlHelpers.html
new file mode 100644
index 00000000..755648b0
--- /dev/null
+++ b/ActiveModelSerializers/SerializationContext/UrlHelpers.html
@@ -0,0 +1,245 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::SerializationContext::UrlHelpers
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::SerializationContext::UrlHelpers
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Included in:
+ Adapter::JsonApi::Link
+
+
+
+ Defined in:
+ lib/active_model_serializers/serialization_context.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) included (base)
+
+
+
+
+
+
+
+
+
+
+
+14
+15
+16
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 14
+
+def self . included ( base )
+ base . send ( :include , SerializationContext . url_helpers )
+end
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) default_url_options
+
+
+
+
+
+
+
+
+
+
+
+18
+19
+20
+
+
+ # File 'lib/active_model_serializers/serialization_context.rb', line 18
+
+def default_url_options
+ SerializationContext . default_url_options
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Test.html b/ActiveModelSerializers/Test.html
new file mode 100644
index 00000000..c1cdc782
--- /dev/null
+++ b/ActiveModelSerializers/Test.html
@@ -0,0 +1,122 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Test
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Test
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Autoload
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/test.rb,
+ lib/active_model_serializers/test/schema.rb, lib/active_model_serializers/test/serializer.rb
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: Schema , Serializer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Test/Schema.html b/ActiveModelSerializers/Test/Schema.html
new file mode 100644
index 00000000..2abae5e9
--- /dev/null
+++ b/ActiveModelSerializers/Test/Schema.html
@@ -0,0 +1,472 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Test::Schema
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Test::Schema
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/test/schema.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+
+
+ Classes: AssertRequestSchema , AssertResponseSchema , AssertSchema
+
+
+
+
+
Constant Summary
+
+
+
+ MissingSchema =
+
+
+ Class . new ( Minitest :: Assertion )
+
+ InvalidSchemaError =
+
+
+ Class . new ( Minitest :: Assertion )
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) assert_request_response_schema (schema_path = nil, message = nil)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+23
+24
+25
+26
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 23
+
+def assert_request_response_schema ( schema_path = nil , message = nil )
+ assert_request_schema ( schema_path , message )
+ assert_response_schema ( schema_path , message )
+end
+
+
+
+
+
+
+
+
+ - (Object ) assert_request_schema (schema_path = nil, message = nil)
+
+
+
+
+
+
+
+
+
+
+
+17
+18
+19
+20
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 17
+
+def assert_request_schema ( schema_path = nil , message = nil )
+ matcher = AssertRequestSchema . new ( schema_path , request , response , message )
+ assert ( matcher . call , matcher . message )
+end
+
+
+
+
+
+
+
+
+ - (Boolean , Minitest::Assertion ) assert_response_schema (schema_path = nil, message = nil)
+
+
+
+
+
+
+
+
+
A Minitest Assertion that test the response is valid against a schema.
+
+
+
+
+
+
+
+
+
+
+12
+13
+14
+15
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 12
+
+def assert_response_schema ( schema_path = nil , message = nil )
+ matcher = AssertResponseSchema . new ( schema_path , request , response , message )
+ assert ( matcher . call , matcher . message )
+end
+
+
+
+
+
+
+
+
+ - (Object ) assert_schema (payload, schema_path = nil, message = nil)
+
+
+
+
+
+
+
+
+
+
+
+28
+29
+30
+31
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 28
+
+def assert_schema ( payload , schema_path = nil , message = nil )
+ matcher = AssertSchema . new ( schema_path , request , response , message , payload )
+ assert ( matcher . call , matcher . message )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Test/Schema/AssertRequestSchema.html b/ActiveModelSerializers/Test/Schema/AssertRequestSchema.html
new file mode 100644
index 00000000..489be542
--- /dev/null
+++ b/ActiveModelSerializers/Test/Schema/AssertRequestSchema.html
@@ -0,0 +1,222 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Schema::AssertRequestSchema
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Schema::AssertRequestSchema
+
+
+
+
+
+
+
+ Inherits:
+
+ AssertSchema
+
+
+ Object
+
+ AssertSchema
+
+ ActiveModelSerializers::Test::Schema::AssertRequestSchema
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/test/schema.rb
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from AssertSchema
+
#message , #payload , #request , #response , #schema_path
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#call
+
+
Constructor Details
+
+
+
+
+
+
Returns a new instance of AssertRequestSchema
+
+
+
+
+
+
+
+
+
+
+
+
+
+131
+132
+133
+134
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 131
+
+def initialize ( * )
+ super
+ @payload = request_params
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Test/Schema/AssertResponseSchema.html b/ActiveModelSerializers/Test/Schema/AssertResponseSchema.html
new file mode 100644
index 00000000..851e3801
--- /dev/null
+++ b/ActiveModelSerializers/Test/Schema/AssertResponseSchema.html
@@ -0,0 +1,222 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Schema::AssertResponseSchema
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Schema::AssertResponseSchema
+
+
+
+
+
+
+
+ Inherits:
+
+ AssertSchema
+
+
+ Object
+
+ AssertSchema
+
+ ActiveModelSerializers::Test::Schema::AssertResponseSchema
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/test/schema.rb
+
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary
+
+
Attributes inherited from AssertSchema
+
#message , #payload , #request , #response , #schema_path
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#call
+
+
Constructor Details
+
+
+
+
+
+
Returns a new instance of AssertResponseSchema
+
+
+
+
+
+
+
+
+
+
+
+
+
+125
+126
+127
+128
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 125
+
+def initialize ( * )
+ super
+ @payload = response_body
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Test/Schema/AssertSchema.html b/ActiveModelSerializers/Test/Schema/AssertSchema.html
new file mode 100644
index 00000000..b4f8c1e2
--- /dev/null
+++ b/ActiveModelSerializers/Test/Schema/AssertSchema.html
@@ -0,0 +1,654 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Schema::AssertSchema
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Schema::AssertSchema
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Test::Schema::AssertSchema
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/test/schema.rb
+
+
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) message
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute message.
+
+
+
+
+
+
+
+
+ - (Object) payload
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute payload.
+
+
+
+
+
+
+
+
+ - (Object) request
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute request.
+
+
+
+
+
+
+
+
+ - (Object) response
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute response.
+
+
+
+
+
+
+
+
+ - (Object) schema_path
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute schema_path.
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (AssertSchema ) initialize (schema_path, request, response, message, payload = nil)
+
+
+
+
+
+
+
+
+
Interface may change.
+
+
+
+
+
+
+
+
+
+
+
+
+
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 40
+
+def initialize ( schema_path , request , response , message , payload = nil )
+ require_json_schema!
+ @request = request
+ @response = response
+ @payload = payload
+ @schema_path = schema_path || schema_path_default
+ @message = message
+ @document_store = JsonSchema :: DocumentStore . new
+ add_schema_to_document_store
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) message
+
+
+
+
+
+
+
+
+
Returns the value of attribute message
+
+
+
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 37
+
+def message
+ @message
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) payload
+
+
+
+
+
+
+
+
+
Returns the value of attribute payload
+
+
+
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 37
+
+def payload
+ @payload
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) request
+
+
+
+
+
+
+
+
+
Returns the value of attribute request
+
+
+
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 37
+
+def request
+ @request
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) response
+
+
+
+
+
+
+
+
+
Returns the value of attribute response
+
+
+
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 37
+
+def response
+ @response
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) schema_path
+
+
+
+
+
+
+
+
+
Returns the value of attribute schema_path
+
+
+
+
+
+
+
+
+
+
+
+
+
+37
+38
+39
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 37
+
+def schema_path
+ @schema_path
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) call
+
+
+
+
+
+
+
+
+
+
+
+51
+52
+53
+54
+55
+56
+
+
+ # File 'lib/active_model_serializers/test/schema.rb', line 51
+
+def call
+ json_schema . expand_references! ( store: document_store )
+ status , errors = json_schema . validate ( response_body )
+ @message = [ message , errors . map ( & :to_s ) . to_sentence ] . compact . join ( ' : ' )
+ status
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Test/Serializer.html b/ActiveModelSerializers/Test/Serializer.html
new file mode 100644
index 00000000..b099e01d
--- /dev/null
+++ b/ActiveModelSerializers/Test/Serializer.html
@@ -0,0 +1,227 @@
+
+
+
+
+
+ Module: ActiveModelSerializers::Test::Serializer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: ActiveModelSerializers::Test::Serializer
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/test/serializer.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+
+
+ Classes: AssertSerializer
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) assert_serializer (expectation, message = nil)
+
+
+
+
+
+
+
+
+
Asserts that the request was rendered with the appropriate serializers.
+
+
assert_serializer " PostSerializer "
+
+assert_serializer " PostSerializer " , " PostSerializer not rendered "
+
+assert_serializer PostSerializer
+
+assert_serializer :post_serializer
+
+assert_serializer %r{ \APost.+\Z }
+
+assert_serializer nil
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+32
+33
+34
+35
+36
+37
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 32
+
+def assert_serializer ( expectation , message = nil )
+ @assert_serializer . expectation = expectation
+ @assert_serializer . message = message
+ @assert_serializer . response = response
+ assert ( @assert_serializer . matches? , @assert_serializer . message )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ActiveModelSerializers/Test/Serializer/AssertSerializer.html b/ActiveModelSerializers/Test/Serializer/AssertSerializer.html
new file mode 100644
index 00000000..e3fec568
--- /dev/null
+++ b/ActiveModelSerializers/Test/Serializer/AssertSerializer.html
@@ -0,0 +1,710 @@
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Serializer::AssertSerializer
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: ActiveModelSerializers::Test::Serializer::AssertSerializer
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ ActiveModelSerializers::Test::Serializer::AssertSerializer
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/active_model_serializers/test/serializer.rb
+
+
+
+
+
+
+
+
+
Instance Attribute Summary (collapse )
+
+
+
+
+
+ - (Object) expectation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute expectation.
+
+
+
+
+
+
+
+
+ - (Object) message
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute message.
+
+
+
+
+
+
+
+
+ - (Object) response
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute response.
+
+
+
+
+
+
+
+
+ - (Object) serializers
+
+
+
+
+
+
+
+
+ readonly
+
+
+
+
+
+
+
+
+
+
+
Returns the value of attribute serializers.
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+
+
Returns a new instance of AssertSerializer
+
+
+
+
+
+
+
+
+
+
+
+
+
+43
+44
+45
+46
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 43
+
+def initialize
+ @serializers = Set . new
+ @_subscribers = [ ]
+end
+
+
+
+
+
+
+
+
+
Instance Attribute Details
+
+
+
+
+
+
+ - (Object ) expectation
+
+
+
+
+
+
+
+
+
Returns the value of attribute expectation
+
+
+
+
+
+
+
+
+
+
+
+
+
+41
+42
+43
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 41
+
+def expectation
+ @expectation
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) message
+
+
+
+
+
+
+
+
+
Returns the value of attribute message
+
+
+
+
+
+
+
+
+
+
+
+
+
+40
+41
+42
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 40
+
+def message
+ @message
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) response
+
+
+
+
+
+
+
+
+
Returns the value of attribute response
+
+
+
+
+
+
+
+
+
+
+
+
+
+41
+42
+43
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 41
+
+def response
+ @response
+end
+
+
+
+
+
+
+
+
+
+
+ - (Object ) serializers
+
+
+
+
+
+
+
+
+
Returns the value of attribute serializers
+
+
+
+
+
+
+
+
+
+
+
+
+
+40
+41
+42
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 40
+
+def serializers
+ @serializers
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Boolean ) matches?
+
+
+
+
+
+
+
+
+
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 52
+
+def matches?
+ response . body
+
+ case expectation
+ when a_serializer? then matches_class?
+ when Symbol then matches_symbol?
+ when String then matches_string?
+ when Regexp then matches_regexp?
+ when NilClass then matches_nil?
+ else fail ArgumentError , ' assert_serializer only accepts a String, Symbol, Regexp, ActiveModel::Serializer, or nil '
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) subscribe
+
+
+
+
+
+
+
+
+
+
+
+66
+67
+68
+69
+70
+71
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 66
+
+def subscribe
+ @_subscribers << ActiveSupport :: Notifications . subscribe ( event_name ) do | _name , _start , _finish , _id , payload |
+ serializer = payload [ :serializer ] . name
+ serializers << serializer
+ end
+end
+
+
+
+
+
+
+
+
+ - (Object ) unsubscribe
+
+
+
+
+
+
+
+
+
+
+
+73
+74
+75
+76
+77
+
+
+ # File 'lib/active_model_serializers/test/serializer.rb', line 73
+
+def unsubscribe
+ @_subscribers . each do | subscriber |
+ ActiveSupport :: Notifications . unsubscribe ( subscriber )
+ end
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BulkCacheFetcher.html b/BulkCacheFetcher.html
new file mode 100644
index 00000000..30bde12d
--- /dev/null
+++ b/BulkCacheFetcher.html
@@ -0,0 +1,321 @@
+
+
+
+
+
+ Class: BulkCacheFetcher
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: BulkCacheFetcher
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ BulkCacheFetcher
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/bulk_cache_fetcher.rb
+
+
+
+
+
Overview
+
+
+
+
+
Constant Summary
+
+
+
+ VERSION =
+
+
+ ' 1.0.0 ' . freeze
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
Constructor Details
+
+
+
+
+ - (BulkCacheFetcher ) initialize (cache)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+14
+15
+16
+
+
+ # File 'lib/bulk_cache_fetcher.rb', line 14
+
+def initialize ( cache )
+ @cache = cache
+end
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) fetch (object_identifiers, options = {}, &finder_block)
+
+
+
+
+
+
+
+
+
Returns a list of objects identified by object_identifiers.
+fetch will try to find the objects from the cache first.
+Identifiers for objects that aren't in the cache will be passed as an
+ordered list to finder_block, where you can find the objects
+as you see fit. These objects should be returned in the same order as the
+identifiers that were passed into the block, because they'll be cached
+under their respective keys. The objects returned by fetch
+will be returned in the same order as the object_identifiers
+passed in.
+
+
options will be passed along unmodified when caching newly
+found objects, so you can use it for things like setting cache expiration.
+
+
+
+
+
+
+
+
+
+
+
+
+
+31
+32
+33
+34
+35
+36
+
+
+ # File 'lib/bulk_cache_fetcher.rb', line 31
+
+def fetch ( object_identifiers , options = { } , & finder_block )
+ object_identifiers = normalize ( object_identifiers )
+ cached_keys_with_objects , uncached_identifiers = partition ( object_identifiers )
+ found_objects = find ( uncached_identifiers , options , & finder_block )
+ coalesce ( cache_keys ( object_identifiers ) , cached_keys_with_objects , found_objects )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Grape.html b/Grape.html
new file mode 100644
index 00000000..1370a0ce
--- /dev/null
+++ b/Grape.html
@@ -0,0 +1,133 @@
+
+
+
+
+
+ Module: Grape
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Grape
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/grape/helpers/active_model_serializers.rb,
+ lib/grape/formatters/active_model_serializers.rb
+
+
+
+
+
+
Overview
+
+
+
A Grape response formatter that can be used as 'formatter :json,
+Grape::Formatters::ActiveModelSerializers'
+
+
Serializer options can be passed as a hash from your Grape endpoint using
+env , or better yet user the
+render helper in Grape::Helpers::ActiveModelSerializers
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ActiveModelSerializers , Formatters , Helpers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Grape/ActiveModelSerializers.html b/Grape/ActiveModelSerializers.html
new file mode 100644
index 00000000..b989de47
--- /dev/null
+++ b/Grape/ActiveModelSerializers.html
@@ -0,0 +1,110 @@
+
+
+
+
+
+ Module: Grape::ActiveModelSerializers
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Grape::ActiveModelSerializers
+
+
+
+
+
+
+
+
+
+ Extended by:
+ ActiveSupport::Concern
+
+
+
+
+
+
+
+ Defined in:
+ lib/grape/active_model_serializers.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Grape/Formatters.html b/Grape/Formatters.html
new file mode 100644
index 00000000..d6f40f80
--- /dev/null
+++ b/Grape/Formatters.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+ Module: Grape::Formatters
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Grape::Formatters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/grape/formatters/active_model_serializers.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ActiveModelSerializers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Grape/Formatters/ActiveModelSerializers.html b/Grape/Formatters/ActiveModelSerializers.html
new file mode 100644
index 00000000..18bbd950
--- /dev/null
+++ b/Grape/Formatters/ActiveModelSerializers.html
@@ -0,0 +1,178 @@
+
+
+
+
+
+ Module: Grape::Formatters::ActiveModelSerializers
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Grape::Formatters::ActiveModelSerializers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/grape/formatters/active_model_serializers.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Class Method Details
+
+
+
+
+
+ + (Object ) call (resource, env)
+
+
+
+
+
+
+
+
+
+
+
+8
+9
+10
+11
+12
+
+
+ # File 'lib/grape/formatters/active_model_serializers.rb', line 8
+
+def self . call ( resource , env )
+ serializer_options = { }
+ serializer_options . merge! ( env [ :active_model_serializer_options ] ) if env [ :active_model_serializer_options ]
+ :: ActiveModelSerializers :: SerializableResource . new ( resource , serializer_options ) . to_json
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Grape/Helpers.html b/Grape/Helpers.html
new file mode 100644
index 00000000..283ca7af
--- /dev/null
+++ b/Grape/Helpers.html
@@ -0,0 +1,115 @@
+
+
+
+
+
+ Module: Grape::Helpers
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Grape::Helpers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/grape/helpers/active_model_serializers.rb
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ActiveModelSerializers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Grape/Helpers/ActiveModelSerializers.html b/Grape/Helpers/ActiveModelSerializers.html
new file mode 100644
index 00000000..1398c895
--- /dev/null
+++ b/Grape/Helpers/ActiveModelSerializers.html
@@ -0,0 +1,195 @@
+
+
+
+
+
+ Module: Grape::Helpers::ActiveModelSerializers
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Grape::Helpers::ActiveModelSerializers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/grape/helpers/active_model_serializers.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) render (resource, active_model_serializer_options = {})
+
+
+
+
+
+
+
+
+
A convenience method for passing ActiveModelSerializers serializer options
+
+
Example: To include relationships in the response: render(post, include:
+['comments'])
+
+
Example: To include pagination meta data: render(posts, meta: { page:
+posts.page, total_pages: posts.total_pages })
+
+
+
+
+
+
+
+
+
+
+
+
+
+10
+11
+12
+13
+
+
+ # File 'lib/grape/helpers/active_model_serializers.rb', line 10
+
+def render ( resource , active_model_serializer_options = { } )
+ env [ :active_model_serializer_options ] = active_model_serializer_options
+ resource
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Rails.html b/Rails.html
new file mode 100644
index 00000000..7e88d43d
--- /dev/null
+++ b/Rails.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+ Module: Rails
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Rails
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/generators/rails/resource_override.rb,
+ lib/generators/rails/serializer_generator.rb
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: Generators
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Rails/Generators.html b/Rails/Generators.html
new file mode 100644
index 00000000..0d6a96b7
--- /dev/null
+++ b/Rails/Generators.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+ Module: Rails::Generators
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Module: Rails::Generators
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/generators/rails/resource_override.rb,
+ lib/generators/rails/serializer_generator.rb
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+
+
+ Classes: ResourceGenerator , SerializerGenerator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Rails/Generators/ResourceGenerator.html b/Rails/Generators/ResourceGenerator.html
new file mode 100644
index 00000000..7b2ef51c
--- /dev/null
+++ b/Rails/Generators/ResourceGenerator.html
@@ -0,0 +1,120 @@
+
+
+
+
+
+ Class: Rails::Generators::ResourceGenerator
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: Rails::Generators::ResourceGenerator
+
+
+
+
+
+
+
+ Inherits:
+
+ Object
+
+
+ Object
+
+ Rails::Generators::ResourceGenerator
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/generators/rails/resource_override.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Rails/Generators/SerializerGenerator.html b/Rails/Generators/SerializerGenerator.html
new file mode 100644
index 00000000..e9805067
--- /dev/null
+++ b/Rails/Generators/SerializerGenerator.html
@@ -0,0 +1,192 @@
+
+
+
+
+
+ Class: Rails::Generators::SerializerGenerator
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class: Rails::Generators::SerializerGenerator
+
+
+
+
+
+
+
+ Inherits:
+
+ NamedBase
+
+
+ Object
+
+ NamedBase
+
+ Rails::Generators::SerializerGenerator
+
+
+ show all
+
+
+
+
+
+
+
+
+
+
+
+ Defined in:
+ lib/generators/rails/serializer_generator.rb
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ (collapse )
+
+
+
+
+
+
+
+
+
+
Instance Method Details
+
+
+
+
+
+ - (Object ) create_serializer_file
+
+
+
+
+
+
+
+
+
+
+
+11
+12
+13
+
+
+ # File 'lib/generators/rails/serializer_generator.rb', line 11
+
+def create_serializer_file
+ template ' serializer.rb.erb ' , File . join ( ' app/serializers ' , class_path , " #{ file_name } _serializer.rb " )
+end
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_index.html b/_index.html
new file mode 100644
index 00000000..4d327284
--- /dev/null
+++ b/_index.html
@@ -0,0 +1,879 @@
+
+
+
+
+
+ Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Documentation by YARD 0.8.7.6
+
+
Alphabetic Index
+
+
File Listing
+
+
+
+
Namespace Listing A-Z
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ F
+
+
+
+ Field
+
+ (ActiveModel::Serializer)
+
+
+
+
+ Fieldset
+
+ (ActiveModel::Serializer)
+
+
+
+
+ Formatters
+
+ (Grape)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ J
+
+
+
+ Json
+
+ (ActiveModel::Serializer::Adapter)
+
+
+
+
+ Json
+
+ (ActiveModelSerializers::Adapter)
+
+
+
+
+ JsonApi
+
+ (ActiveModel::Serializer::Adapter)
+
+
+
+
+ JsonApi
+
+ (ActiveModelSerializers::Adapter)
+
+
+
+
+ JsonPointer
+
+ (ActiveModelSerializers)
+
+
+
+
+ Jsonapi
+
+ (ActiveModelSerializers)
+
+
+
+
+ Jsonapi
+
+ (ActiveModelSerializers::Adapter::JsonApi)
+
+
+
+
+
+
+
+
+
+
+
+ L
+
+
+
+ Link
+
+ (ActiveModelSerializers::Adapter::JsonApi)
+
+
+
+
+ Links
+
+ (ActiveModel::Serializer)
+
+
+
+
+ Lint
+
+ (ActiveModel::Serializer)
+
+
+
+
+ LogSubscriber
+
+ (ActiveModelSerializers::Logging)
+
+
+
+
+ Logging
+
+ (ActiveModelSerializers)
+
+
+
+
+
+
+
+
+ M
+
+
+
+ Macros
+
+ (ActiveModelSerializers::Logging)
+
+
+
+
+ Meta
+
+ (ActiveModelSerializers::Adapter::JsonApi)
+
+
+
+
+ Meta
+
+ (ActiveModel::Serializer)
+
+
+
+
+ Model
+
+ (ActiveModelSerializers)
+
+
+
+
+
+
+
+
+ N
+
+
+
+ Null
+
+ (ActiveModelSerializers::Adapter)
+
+
+
+
+ Null
+
+ (ActiveModel::Serializer)
+
+
+
+
+ Null
+
+ (ActiveModel::Serializer::Adapter)
+
+
+
+
+
+
+
+
+ P
+
+
+
+ PaginationLinks
+
+ (ActiveModelSerializers::Adapter::JsonApi)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ T
+
+
+
+ Test
+
+ (ActiveModelSerializers)
+
+
+
+
+ Tests
+
+ (ActiveModel::Serializer::Lint)
+
+
+
+
+ Type
+
+ (ActiveModel::Serializer)
+
+
+
+
+
+
+
+
+ U
+
+
+
+ UrlHelpers
+
+ (ActiveModelSerializers::SerializationContext)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/class_list.html b/class_list.html
new file mode 100644
index 00000000..d5ea34bc
--- /dev/null
+++ b/class_list.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Class List
+
+
+
+
+
+
+
diff --git a/css/common.css b/css/common.css
new file mode 100644
index 00000000..cf25c452
--- /dev/null
+++ b/css/common.css
@@ -0,0 +1 @@
+/* Override this file with custom rules */
\ No newline at end of file
diff --git a/css/full_list.css b/css/full_list.css
new file mode 100644
index 00000000..c918cf19
--- /dev/null
+++ b/css/full_list.css
@@ -0,0 +1,57 @@
+body {
+ margin: 0;
+ font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
+ font-size: 13px;
+ height: 101%;
+ overflow-x: hidden;
+}
+
+h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; }
+.clear { clear: both; }
+#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; }
+#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; }
+#full_list { padding: 0; list-style: none; margin-left: 0; }
+#full_list ul { padding: 0; }
+#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; }
+#noresults { padding: 7px 12px; }
+#content.insearch #noresults { margin-left: 7px; }
+ul.collapsed ul, ul.collapsed li { display: none; }
+ul.collapsed.search_uncollapsed { display: block; }
+ul.collapsed.search_uncollapsed li { display: list-item; }
+li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
+li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
+li { color: #888; cursor: pointer; }
+li.deprecated { text-decoration: line-through; font-style: italic; }
+li.r1 { background: #f0f0f0; }
+li.r2 { background: #fafafa; }
+li:hover { background: #ddd; }
+li small:before { content: "("; }
+li small:after { content: ")"; }
+li small.search_info { display: none; }
+a:link, a:visited { text-decoration: none; color: #05a; }
+li.clicked { background: #05a; color: #ccc; }
+li.clicked a:link, li.clicked a:visited { color: #eee; }
+li.clicked a.toggle { opacity: 0.5; background-position: bottom right; }
+li.collapsed.clicked a.toggle { background-position: top right; }
+#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
+#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; }
+#nav a:link, #nav a:visited { color: #358; }
+#nav a:hover { background: transparent; color: #5af; }
+.frames #nav span:after { content: ' | '; }
+.frames #nav span:last-child:after { content: ''; }
+
+.frames #content h1 { margin-top: 0; }
+.frames li { white-space: nowrap; cursor: normal; }
+.frames li small { display: block; font-size: 0.8em; }
+.frames li small:before { content: ""; }
+.frames li small:after { content: ""; }
+.frames li small.search_info { display: none; }
+.frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; }
+.frames #content.insearch #search { background-position: center right; }
+.frames #search input { width: 110px; }
+.frames #nav { display: block; }
+
+#full_list.insearch li { display: none; }
+#full_list.insearch li.found { display: list-item; padding-left: 10px; }
+#full_list.insearch li a.toggle { display: none; }
+#full_list.insearch li small.search_info { display: block; }
diff --git a/css/style.css b/css/style.css
new file mode 100644
index 00000000..96307c56
--- /dev/null
+++ b/css/style.css
@@ -0,0 +1,339 @@
+body {
+ padding: 0 20px;
+ font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
+ font-size: 13px;
+}
+body.frames { padding: 0 5px; }
+h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; }
+h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; }
+h1.title { margin-bottom: 10px; }
+h1.alphaindex { margin-top: 0; font-size: 22px; }
+h2 {
+ padding: 0;
+ padding-bottom: 3px;
+ border-bottom: 1px #aaa solid;
+ font-size: 1.4em;
+ margin: 1.8em 0 0.5em;
+}
+h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; }
+.clear { clear: both; }
+.inline { display: inline; }
+.inline p:first-child { display: inline; }
+.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; }
+.docstring h1 { font-size: 1.2em; }
+.docstring h2 { font-size: 1.1em; }
+.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; }
+.summary_desc .object_link, .docstring .object_link { font-family: monospace; }
+.rdoc-term { padding-right: 25px; font-weight: bold; }
+.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; }
+
+/* style for */
+#filecontents table, .docstring table { border-collapse: collapse; }
+#filecontents table th, #filecontents table td,
+.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; }
+#filecontents table tr:nth-child(odd),
+.docstring table tr:nth-child(odd) { background: #eee; }
+#filecontents table tr:nth-child(even),
+.docstring table tr:nth-child(even) { background: #fff; }
+#filecontents table th, .docstring table th { background: #fff; }
+
+/* style for */
+#filecontents li > p, .docstring li > p { margin: 0px; }
+#filecontents ul, .docstring ul { padding-left: 20px; }
+/* style for */
+#filecontents dl, .docstring dl { border: 1px solid #ccc; }
+#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; }
+#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; }
+#filecontents dd > p, .docstring dd > p { margin: 0px; }
+
+.note {
+ color: #222;
+ -moz-border-radius: 3px; -webkit-border-radius: 3px;
+ background: #e3e4e3; border: 1px solid #d5d5d5; padding: 7px 10px;
+ display: block;
+}
+.note.todo { background: #ffffc5; border-color: #ececaa; }
+.note.returns_void { background: #efefef; }
+.note.deprecated { background: #ffe5e5; border-color: #e9dada; }
+.note.private { background: #ffffc5; border-color: #ececaa; }
+.note.title { padding: 1px 5px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; }
+.summary_signature + .note.title { margin-left: 7px; }
+h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; }
+.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; }
+.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; }
+.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; }
+.note.title.private { background: #d5d5d5; border-color: #c5c5c5; }
+.note.title.not_defined_here { background: transparent; border: none; font-style: italic; }
+.discussion .note { margin-top: 6px; }
+.discussion .note:first-child { margin-top: 0; }
+
+h3.inherited {
+ font-style: italic;
+ font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
+ font-weight: normal;
+ padding: 0;
+ margin: 0;
+ margin-top: 12px;
+ margin-bottom: 3px;
+ font-size: 13px;
+}
+p.inherited {
+ padding: 0;
+ margin: 0;
+ margin-left: 25px;
+}
+
+#filecontents dl.box, dl.box {
+ border: 0;
+ width: 520px;
+ font-size: 1em;
+}
+#filecontents dl.box dt, dl.box dt {
+ float: left;
+ display: block;
+ width: 100px;
+ margin: 0;
+ text-align: right;
+ font-weight: bold;
+ background: transparent;
+ border: 1px solid #aaa;
+ border-width: 1px 0px 0px 1px;
+ padding: 6px 0;
+ padding-right: 10px;
+}
+#filecontents dl.box dd, dl.box dd {
+ float: left;
+ display: block;
+ width: 380px;
+ margin: 0;
+ padding: 6px 0;
+ padding-right: 20px;
+ border: 1px solid #aaa;
+ border-width: 1px 1px 0 0;
+}
+#filecontents dl.box .last, dl.box .last {
+ border-bottom: 1px solid #aaa;
+}
+#filecontents dl.box .r1, dl.box .r1 { background: #eee; }
+
+ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
+.index_inline_list { padding-left: 0; font-size: 1.1em; }
+.index_inline_list li { list-style: none; display: inline; padding: 7px 12px; line-height: 35px; }
+
+dl.constants { margin-left: 40px; }
+dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
+dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; }
+
+.summary_desc { margin-left: 32px; display: block; font-family: sans-serif; }
+.summary_desc tt { font-size: 0.9em; }
+dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; }
+dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; }
+dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; }
+dl.constants .discussion *:first-child { margin-top: 0; }
+dl.constants .discussion *:last-child { margin-bottom: 0; }
+
+.method_details { border-top: 1px dotted #aaa; margin-top: 15px; padding-top: 0; }
+.method_details.first { border: 0; }
+p.signature, h3.signature {
+ font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace;
+ padding: 6px 10px; margin-top: 18px;
+ background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
+}
+p.signature tt,
+h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; }
+p.signature .overload,
+h3.signature .overload { display: block; }
+p.signature .extras,
+h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; }
+p.signature .not_defined_here,
+h3.signature .not_defined_here,
+p.signature .aliases,
+h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; }
+p.signature .aliases .names,
+h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; }
+
+.tags .tag_title { font-size: 1em; margin-bottom: 0; font-weight: bold; }
+.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; }
+.tags ul li { margin-bottom: 3px; }
+.tags ul .name { font-family: monospace; font-weight: bold; }
+.tags ul .note { padding: 3px 6px; }
+.tags { margin-bottom: 12px; }
+
+.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; }
+.tags .examples .inline p { padding: 0; margin: 0; margin-left: 15px; font-weight: bold; font-size: 0.9em; }
+
+.tags .overload .overload_item { list-style: none; margin-bottom: 25px; }
+.tags .overload .overload_item .signature {
+ padding: 2px 8px;
+ background: #e5e8ff; border: 1px solid #d8d8e5; -moz-border-radius: 3px; -webkit-border-radius: 3px;
+}
+.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; }
+.tags .overload .docstring { margin-top: 15px; }
+
+.defines { display: none; }
+
+#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; }
+
+.showSource { font-size: 0.9em; }
+.showSource a:link, .showSource a:visited { text-decoration: none; color: #666; }
+
+#content a:link, #content a:visited { text-decoration: none; color: #05a; }
+#content a:hover { background: #ffffa5; }
+div.docstring, p.docstring { margin-right: 6em; }
+
+ul.summary {
+ list-style: none;
+ font-family: monospace;
+ font-size: 1em;
+ line-height: 1.5em;
+}
+ul.summary a:link, ul.summary a:visited {
+ text-decoration: none; font-size: 1.1em;
+}
+ul.summary li { margin-bottom: 5px; }
+.summary .summary_signature {
+ padding: 1px 10px;
+ background: #eaeaff; border: 1px solid #dfdfe5;
+ -moz-border-radius: 3px; -webkit-border-radius: 3px;
+}
+.summary_signature:hover { background: #eeeeff; cursor: pointer; }
+ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;}
+ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
+#content .summary_signature:hover a:link,
+#content .summary_signature:hover a:visited {
+ background: transparent;
+ color: #48f;
+}
+
+p.inherited a { font-family: monospace; font-size: 0.9em; }
+p.inherited { word-spacing: 5px; font-size: 1.2em; }
+
+p.children { font-size: 1.2em; }
+p.children a { font-size: 0.9em; }
+p.children strong { font-size: 0.8em; }
+p.children strong.modules { padding-left: 5px; }
+
+ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
+ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
+ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; }
+ul.fullTree li:first-child { padding-top: 0; background: transparent; }
+ul.fullTree li:last-child { padding-bottom: 0; }
+.showAll ul.fullTree { display: block; }
+.showAll .inheritName { display: none; }
+
+#search { position: absolute; right: 14px; top: 0px; }
+#search a:link, #search a:visited {
+ display: block; float: left; margin-right: 4px;
+ padding: 8px 10px; text-decoration: none; color: #05a;
+ border: 1px solid #d8d8e5;
+ -moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px;
+ -webkit-border-bottom-left-radius: 3px; -webkit-border-bottom-right-radius: 3px;
+ background: #eaf0ff;
+ -webkit-box-shadow: -1px 1px 3px #ddd;
+}
+#search a:hover { background: #f5faff; color: #06b; }
+#search a.active {
+ background: #568; padding-bottom: 20px; color: #fff; border: 1px solid #457;
+ -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;
+ -webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;
+}
+#search a.inactive { color: #999; }
+.frames #search { display: none; }
+.inheritanceTree, .toggleDefines { float: right; }
+
+#menu { font-size: 1.3em; color: #bbb; top: -5px; position: relative; }
+#menu .title, #menu a { font-size: 0.7em; }
+#menu .title a { font-size: 1em; }
+#menu .title { color: #555; }
+#menu a:link, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; }
+#menu a:hover { color: #05a; }
+#menu .noframes { display: inline; }
+.frames #menu .noframes { display: inline; float: right; }
+
+#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; }
+#footer a:link, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; }
+#footer a:hover { color: #05a; }
+
+#listing ul.alpha { font-size: 1.1em; }
+#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; }
+#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; }
+#listing ul.alpha ul { margin: 0; padding-left: 15px; }
+#listing ul small { color: #666; font-size: 0.7em; }
+
+li.r1 { background: #f0f0f0; }
+li.r2 { background: #fafafa; }
+
+#search_frame {
+ z-index: 9999;
+ background: #fff;
+ display: none;
+ position: absolute;
+ top: 36px;
+ right: 18px;
+ width: 500px;
+ height: 80%;
+ overflow-y: scroll;
+ border: 1px solid #999;
+ border-collapse: collapse;
+ -webkit-box-shadow: -7px 5px 25px #aaa;
+ -moz-box-shadow: -7px 5px 25px #aaa;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+}
+
+#content ul.summary li.deprecated .summary_signature a:link,
+#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; }
+
+#toc {
+ padding: 20px; padding-right: 30px; border: 1px solid #ddd; float: right; background: #fff; margin-left: 20px; margin-bottom: 20px;
+ max-width: 300px;
+ -webkit-box-shadow: -2px 2px 6px #bbb;
+ -moz-box-shadow: -2px 2px 6px #bbb;
+ z-index: 5000;
+ position: relative;
+ overflow-x: auto;
+}
+#toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; }
+#toc.nofloat.hidden { padding: 0; background: 0; margin-bottom: 5px; }
+#toc .title { margin: 0; }
+#toc ol { padding-left: 1.8em; }
+#toc li { font-size: 1.1em; line-height: 1.7em; }
+#toc > ol > li { font-size: 1.1em; font-weight: bold; }
+#toc ol > ol { font-size: 0.9em; }
+#toc ol ol > ol { padding-left: 2.3em; }
+#toc ol + li { margin-top: 0.3em; }
+#toc.hidden { padding: 10px; background: #f6f6f6; -webkit-box-shadow: none; -moz-box-shadow: none; }
+#filecontents h1 + #toc.nofloat { margin-top: 0; }
+
+/* syntax highlighting */
+.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; }
+#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; }
+#filecontents pre.code, .docstring pre.code { display: block; }
+.source_code .lines { padding-right: 12px; color: #555; text-align: right; }
+#filecontents pre.code, .docstring pre.code,
+.tags pre.example { padding: 5px 12px; margin-top: 4px; border: 1px solid #eef; background: #f5f5ff; }
+pre.code { color: #000; }
+pre.code .info.file { color: #555; }
+pre.code .val { color: #036A07; }
+pre.code .tstring_content,
+pre.code .heredoc_beg, pre.code .heredoc_end,
+pre.code .qwords_beg, pre.code .qwords_end,
+pre.code .tstring, pre.code .dstring { color: #036A07; }
+pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s,
+pre.code .rubyid_to_sym, pre.code .rubyid_to_f,
+pre.code .dot + pre.code .id,
+pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; }
+pre.code .comment { color: #0066FF; }
+pre.code .const, pre.code .constant { color: #585CF6; }
+pre.code .label,
+pre.code .symbol { color: #C5060B; }
+pre.code .kw,
+pre.code .rubyid_require,
+pre.code .rubyid_extend,
+pre.code .rubyid_include { color: #0000FF; }
+pre.code .ivar { color: #318495; }
+pre.code .gvar,
+pre.code .rubyid_backref,
+pre.code .rubyid_nth_ref { color: #6D79DE; }
+pre.code .regexp, .dregexp { color: #036A07; }
+pre.code a { border-bottom: 1px dotted #bbf; }
diff --git a/file.README.html b/file.README.html
new file mode 100644
index 00000000..6f439100
--- /dev/null
+++ b/file.README.html
@@ -0,0 +1,262 @@
+
+
+
+
+
+ File: README
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
ActiveModelSerializers
+
+
+ Build Status
+
+
+
+
+
+
+ Code Quality
+
+
+
+
+
+
+
+ Issue Stats
+
+ Pulse
+
+
+
+
About
+
+
ActiveModelSerializers brings convention over configuration to your JSON
+generation.
+
+
ActiveModelSerializers works through two components:
+serializers and adapters .
+
+
Serializers describe which attributes and relationships should be
+serialized.
+
+
Adapters describe how attributes and relationships should be
+serialized.
+
+
SerializableResource co-ordinates the resource, Adapter and Serializer to
+produce the resource serialization. The serialization has the
+#as_json, #to_json and
+#serializable_hash methods used by the Rails JSON Renderer.
+(SerializableResource actually delegates these methods to the adapter.)
+
+
By default ActiveModelSerializers will use the Attributes
+Adapter (no JSON root). But we strongly advise you to use
+JsonApi Adapter , which follows 1.0 of the format specified
+in jsonapi.org/format . Check how to
+change the adapter in the sections below.
+
+
0.10.x is not backward compatible with
+0.9.x nor 0.8.x.
+
+
0.10.x is based on the 0.8.0 code, but with a
+more flexible architecture. We'd love your help. Learn how you can help here.
+
+
It is generally safe and recommended to use the master branch.
+
+
Installation
+
+
Add this line to your application's Gemfile:
+
+
gem ' active_model_serializers ' , ' ~> 0.10.0 '
+
+
+
And then execute:
+
+
$ bundle
+
+
Getting Started
+
+
See Getting Started for the
+nuts and bolts.
+
+
More information is available in the Guides and High-level behavior .
+
+
Getting Help
+
+
If you find a bug, please report an Issue
+and see our contributing guide .
+
+
If you have a question, please post
+to Stack Overflow .
+
+
If you'd like to chat, we have a community slack .
+
+
Thanks!
+
+
Documentation
+
+
+
High-level behavior
+
+
Choose an adapter from adapters :
+
+
ActiveModelSerializers . config . adapter = :json_api
+
+
Given a serializable
+model :
+
+
class SomeResource < ActiveRecord :: Base
+ end
+class SomeResource < ActiveModelSerializers :: Model
+ attr_accessor :title , :body
+end
+
+
+
And initialized as:
+
+
resource = SomeResource . new ( title: ' ActiveModelSerializers ' , body: ' Convention over configuration ' )
+
+
+
Given a serializer for the serializable model:
+
+
class SomeSerializer < ActiveModel :: Serializer
+ attribute :title , key: :name
+ attributes :body
+end
+
+
+
The model can be serialized as:
+
+
options = { }
+serialization = ActiveModelSerializers :: SerializableResource . new ( resource , options )
+serialization . to_json
+serialization . as_json
+
+
+
SerializableResource delegates to the adapter, which it builds as:
+
+
adapter_options = { }
+adapter = ActiveModelSerializers :: Adapter . create ( serializer , adapter_options )
+adapter . to_json
+adapter . as_json
+adapter . serializable_hash
+
+
+
The adapter formats the serializer's attributes and associations
+(a.k.a. includes):
+
+
serializer_options = { }
+serializer = SomeSerializer . new ( resource , serializer_options )
+serializer . attributes
+serializer . associations
+
+
+
See ARCHITECTURE.md for more
+information.
+
+
Contributing
+
+
See CONTRIBUTING.md
+
+
+
+
+
+
\ No newline at end of file
diff --git a/file_list.html b/file_list.html
new file mode 100644
index 00000000..6bf67e5a
--- /dev/null
+++ b/file_list.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ File List
+
+
+
+
+
+
+
diff --git a/frames.html b/frames.html
new file mode 100644
index 00000000..87a4a6df
--- /dev/null
+++ b/frames.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
diff --git a/index.html b/index.html
new file mode 100644
index 00000000..c6383cde
--- /dev/null
+++ b/index.html
@@ -0,0 +1,262 @@
+
+
+
+
+
+ File: README
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
ActiveModelSerializers
+
+
+ Build Status
+
+
+
+
+
+
+ Code Quality
+
+
+
+
+
+
+
+ Issue Stats
+
+ Pulse
+
+
+
+
About
+
+
ActiveModelSerializers brings convention over configuration to your JSON
+generation.
+
+
ActiveModelSerializers works through two components:
+serializers and adapters .
+
+
Serializers describe which attributes and relationships should be
+serialized.
+
+
Adapters describe how attributes and relationships should be
+serialized.
+
+
SerializableResource co-ordinates the resource, Adapter and Serializer to
+produce the resource serialization. The serialization has the
+#as_json, #to_json and
+#serializable_hash methods used by the Rails JSON Renderer.
+(SerializableResource actually delegates these methods to the adapter.)
+
+
By default ActiveModelSerializers will use the Attributes
+Adapter (no JSON root). But we strongly advise you to use
+JsonApi Adapter , which follows 1.0 of the format specified
+in jsonapi.org/format . Check how to
+change the adapter in the sections below.
+
+
0.10.x is not backward compatible with
+0.9.x nor 0.8.x.
+
+
0.10.x is based on the 0.8.0 code, but with a
+more flexible architecture. We'd love your help. Learn how you can help here.
+
+
It is generally safe and recommended to use the master branch.
+
+
Installation
+
+
Add this line to your application's Gemfile:
+
+
gem ' active_model_serializers ' , ' ~> 0.10.0 '
+
+
+
And then execute:
+
+
$ bundle
+
+
Getting Started
+
+
See Getting Started for the
+nuts and bolts.
+
+
More information is available in the Guides and High-level behavior .
+
+
Getting Help
+
+
If you find a bug, please report an Issue
+and see our contributing guide .
+
+
If you have a question, please post
+to Stack Overflow .
+
+
If you'd like to chat, we have a community slack .
+
+
Thanks!
+
+
Documentation
+
+
+
High-level behavior
+
+
Choose an adapter from adapters :
+
+
ActiveModelSerializers . config . adapter = :json_api
+
+
Given a serializable
+model :
+
+
class SomeResource < ActiveRecord :: Base
+ end
+class SomeResource < ActiveModelSerializers :: Model
+ attr_accessor :title , :body
+end
+
+
+
And initialized as:
+
+
resource = SomeResource . new ( title: ' ActiveModelSerializers ' , body: ' Convention over configuration ' )
+
+
+
Given a serializer for the serializable model:
+
+
class SomeSerializer < ActiveModel :: Serializer
+ attribute :title , key: :name
+ attributes :body
+end
+
+
+
The model can be serialized as:
+
+
options = { }
+serialization = ActiveModelSerializers :: SerializableResource . new ( resource , options )
+serialization . to_json
+serialization . as_json
+
+
+
SerializableResource delegates to the adapter, which it builds as:
+
+
adapter_options = { }
+adapter = ActiveModelSerializers :: Adapter . create ( serializer , adapter_options )
+adapter . to_json
+adapter . as_json
+adapter . serializable_hash
+
+
+
The adapter formats the serializer's attributes and associations
+(a.k.a. includes):
+
+
serializer_options = { }
+serializer = SomeSerializer . new ( resource , serializer_options )
+serializer . attributes
+serializer . associations
+
+
+
See ARCHITECTURE.md for more
+information.
+
+
Contributing
+
+
See CONTRIBUTING.md
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/app.js b/js/app.js
new file mode 100644
index 00000000..d933ebcf
--- /dev/null
+++ b/js/app.js
@@ -0,0 +1,219 @@
+function createSourceLinks() {
+ $('.method_details_list .source_code').
+ before("[View source ] ");
+ $('.toggleSource').toggle(function() {
+ $(this).parent().nextAll('.source_code').slideDown(100);
+ $(this).text("Hide source");
+ },
+ function() {
+ $(this).parent().nextAll('.source_code').slideUp(100);
+ $(this).text("View source");
+ });
+}
+
+function createDefineLinks() {
+ var tHeight = 0;
+ $('.defines').after(" more... ");
+ $('.toggleDefines').toggle(function() {
+ tHeight = $(this).parent().prev().height();
+ $(this).prev().show();
+ $(this).parent().prev().height($(this).parent().height());
+ $(this).text("(less)");
+ },
+ function() {
+ $(this).prev().hide();
+ $(this).parent().prev().height(tHeight);
+ $(this).text("more...");
+ });
+}
+
+function createFullTreeLinks() {
+ var tHeight = 0;
+ $('.inheritanceTree').toggle(function() {
+ tHeight = $(this).parent().prev().height();
+ $(this).parent().toggleClass('showAll');
+ $(this).text("(hide)");
+ $(this).parent().prev().height($(this).parent().height());
+ },
+ function() {
+ $(this).parent().toggleClass('showAll');
+ $(this).parent().prev().height(tHeight);
+ $(this).text("show all");
+ });
+}
+
+function fixBoxInfoHeights() {
+ $('dl.box dd.r1, dl.box dd.r2').each(function() {
+ $(this).prev().height($(this).height());
+ });
+}
+
+function searchFrameLinks() {
+ $('.full_list_link').click(function() {
+ toggleSearchFrame(this, $(this).attr('href'));
+ return false;
+ });
+}
+
+function toggleSearchFrame(id, link) {
+ var frame = $('#search_frame');
+ $('#search a').removeClass('active').addClass('inactive');
+ if (frame.attr('src') == link && frame.css('display') != "none") {
+ frame.slideUp(100);
+ $('#search a').removeClass('active inactive');
+ }
+ else {
+ $(id).addClass('active').removeClass('inactive');
+ frame.attr('src', link).slideDown(100);
+ }
+}
+
+function linkSummaries() {
+ $('.summary_signature').click(function() {
+ document.location = $(this).find('a').attr('href');
+ });
+}
+
+function framesInit() {
+ if (hasFrames) {
+ document.body.className = 'frames';
+ $('#menu .noframes a').attr('href', document.location);
+ try {
+ window.top.document.title = $('html head title').text();
+ } catch(error) {
+ // some browsers will not allow this when serving from file://
+ // but we don't want to stop the world.
+ }
+ }
+ else {
+ $('#menu .noframes a').text('frames').attr('href', framesUrl);
+ }
+}
+
+function keyboardShortcuts() {
+ if (window.top.frames.main) return;
+ $(document).keypress(function(evt) {
+ if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
+ if (typeof evt.target !== "undefined" &&
+ (evt.target.nodeName == "INPUT" ||
+ evt.target.nodeName == "TEXTAREA")) return;
+ switch (evt.charCode) {
+ case 67: case 99: $('#class_list_link').click(); break; // 'c'
+ case 77: case 109: $('#method_list_link').click(); break; // 'm'
+ case 70: case 102: $('#file_list_link').click(); break; // 'f'
+ default: break;
+ }
+ });
+}
+
+function summaryToggle() {
+ $('.summary_toggle').click(function() {
+ if (localStorage) {
+ localStorage.summaryCollapsed = $(this).text();
+ }
+ $('.summary_toggle').each(function() {
+ $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
+ var next = $(this).parent().parent().nextAll('ul.summary').first();
+ if (next.hasClass('compact')) {
+ next.toggle();
+ next.nextAll('ul.summary').first().toggle();
+ }
+ else if (next.hasClass('summary')) {
+ var list = $('');
+ list.html(next.html());
+ list.find('.summary_desc, .note').remove();
+ list.find('a').each(function() {
+ $(this).html($(this).find('strong').html());
+ $(this).parent().html($(this)[0].outerHTML);
+ });
+ next.before(list);
+ next.toggle();
+ }
+ });
+ return false;
+ });
+ if (localStorage) {
+ if (localStorage.summaryCollapsed == "collapse") {
+ $('.summary_toggle').first().click();
+ }
+ else localStorage.summaryCollapsed = "expand";
+ }
+}
+
+function fixOutsideWorldLinks() {
+ $('a').each(function() {
+ if (window.location.host != this.host) this.target = '_parent';
+ });
+}
+
+function generateTOC() {
+ if ($('#filecontents').length === 0) return;
+ var _toc = $(' ');
+ var show = false;
+ var toc = _toc;
+ var counter = 0;
+ var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
+ var i;
+ if ($('#filecontents h1').length > 1) tags.unshift('h1');
+ for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
+ var lastTag = parseInt(tags[0][1], 10);
+ $(tags.join(', ')).each(function() {
+ if ($(this).parents('.method_details .docstring').length != 0) return;
+ if (this.id == "filecontents") return;
+ show = true;
+ var thisTag = parseInt(this.tagName[1], 10);
+ if (this.id.length === 0) {
+ var proposedId = $(this).attr('toc-id');
+ if (typeof(proposedId) != "undefined") this.id = proposedId;
+ else {
+ var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
+ if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
+ this.id = proposedId;
+ }
+ }
+ if (thisTag > lastTag) {
+ for (i = 0; i < thisTag - lastTag; i++) {
+ var tmp = $(' '); toc.append(tmp); toc = tmp;
+ }
+ }
+ if (thisTag < lastTag) {
+ for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
+ }
+ var title = $(this).attr('toc-title');
+ if (typeof(title) == "undefined") title = $(this).text();
+ toc.append(' ' + title + ' ');
+ lastTag = thisTag;
+ });
+ if (!show) return;
+ html = '';
+ $('#content').prepend(html);
+ $('#toc').append(_toc);
+ $('#toc .hide_toc').toggle(function() {
+ $('#toc .top').slideUp('fast');
+ $('#toc').toggleClass('hidden');
+ $('#toc .title small').toggle();
+ }, function() {
+ $('#toc .top').slideDown('fast');
+ $('#toc').toggleClass('hidden');
+ $('#toc .title small').toggle();
+ });
+ $('#toc .float_toc').toggle(function() {
+ $(this).text('float');
+ $('#toc').toggleClass('nofloat');
+ }, function() {
+ $(this).text('left');
+ $('#toc').toggleClass('nofloat');
+ });
+}
+
+$(framesInit);
+$(createSourceLinks);
+$(createDefineLinks);
+$(createFullTreeLinks);
+$(fixBoxInfoHeights);
+$(searchFrameLinks);
+$(linkSummaries);
+$(keyboardShortcuts);
+$(summaryToggle);
+$(fixOutsideWorldLinks);
+$(generateTOC);
diff --git a/js/full_list.js b/js/full_list.js
new file mode 100644
index 00000000..4b10377e
--- /dev/null
+++ b/js/full_list.js
@@ -0,0 +1,181 @@
+var inSearch = null;
+var searchIndex = 0;
+var searchCache = [];
+var searchString = '';
+var regexSearchString = '';
+var caseSensitiveMatch = false;
+var ignoreKeyCodeMin = 8;
+var ignoreKeyCodeMax = 46;
+var commandKey = 91;
+
+RegExp.escape = function(text) {
+ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
+}
+
+function fullListSearch() {
+ // generate cache
+ searchCache = [];
+ $('#full_list li').each(function() {
+ var link = $(this).find('.object_link a');
+ if (link.length === 0) return;
+ var fullName = link.attr('title').split(' ')[0];
+ searchCache.push({name:link.text(), fullName:fullName, node:$(this), link:link});
+ });
+
+ $('#search input').keyup(function(event) {
+ if ((event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax)
+ || event.keyCode == commandKey)
+ return;
+ searchString = this.value;
+ caseSensitiveMatch = searchString.match(/[A-Z]/) != null;
+ regexSearchString = RegExp.escape(searchString);
+ if (caseSensitiveMatch) {
+ regexSearchString += "|" +
+ $.map(searchString.split(''), function(e) { return RegExp.escape(e); }).
+ join('.+?');
+ }
+ if (searchString === "") {
+ clearTimeout(inSearch);
+ inSearch = null;
+ $('ul .search_uncollapsed').removeClass('search_uncollapsed');
+ $('#full_list, #content').removeClass('insearch');
+ $('#full_list li').removeClass('found').each(function() {
+
+ var link = $(this).find('.object_link a');
+ if (link.length > 0) link.text(link.text());
+ });
+ if (clicked) {
+ clicked.parents('ul').each(function() {
+ $(this).removeClass('collapsed').prev().removeClass('collapsed');
+ });
+ }
+ highlight();
+ }
+ else {
+ if (inSearch) clearTimeout(inSearch);
+ searchIndex = 0;
+ lastRowClass = '';
+ $('#full_list, #content').addClass('insearch');
+ $('#noresults').text('');
+ searchItem();
+ }
+ });
+
+ $('#search input').focus();
+ $('#full_list').after("
");
+}
+
+var lastRowClass = '';
+function searchItem() {
+ for (var i = 0; i < searchCache.length / 50; i++) {
+ var item = searchCache[searchIndex];
+ var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name);
+ var matchString = regexSearchString;
+ var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i");
+ if (searchName.match(matchRegexp) == null) {
+ item.node.removeClass('found');
+ }
+ else {
+ item.node.css('padding-left', '10px').addClass('found');
+ item.node.parents().addClass('search_uncollapsed');
+ item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1');
+ lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2';
+ item.link.html(item.name.replace(matchRegexp, "$& "));
+ }
+
+ if (searchCache.length === searchIndex + 1) {
+ searchDone();
+ return;
+ }
+ else {
+ searchIndex++;
+ }
+ }
+ inSearch = setTimeout('searchItem()', 0);
+}
+
+function searchDone() {
+ highlight(true);
+ if ($('#full_list li:visible').size() === 0) {
+ $('#noresults').text('No results were found.').hide().fadeIn();
+ }
+ else {
+ $('#noresults').text('');
+ }
+ $('#content').removeClass('insearch');
+ clearTimeout(inSearch);
+ inSearch = null;
+}
+
+clicked = null;
+function linkList() {
+ $('#full_list li, #full_list li a:last').click(function(evt) {
+ if ($(this).hasClass('toggle')) return true;
+ if (this.tagName.toLowerCase() == "li") {
+ if ($(this).find('.object_link a').length === 0) {
+ $(this).children('a.toggle').click();
+ return false;
+ }
+ var toggle = $(this).children('a.toggle');
+ if (toggle.size() > 0 && evt.pageX < toggle.offset().left) {
+ toggle.click();
+ return false;
+ }
+ }
+ if (clicked) clicked.removeClass('clicked');
+ var win;
+ try {
+ win = window.top.frames.main ? window.top.frames.main : window.parent;
+ } catch (e) { win = window.parent; }
+ if (this.tagName.toLowerCase() == "a") {
+ clicked = $(this).parents('li').addClass('clicked');
+ win.location = this.href;
+ }
+ else {
+ clicked = $(this).addClass('clicked');
+ win.location = $(this).find('a:last').attr('href');
+ }
+ return false;
+ });
+}
+
+function collapse() {
+ if (!$('#full_list').hasClass('class')) return;
+ $('#full_list.class a.toggle').click(function() {
+ $(this).parent().toggleClass('collapsed').next().toggleClass('collapsed');
+ highlight();
+ return false;
+ });
+ $('#full_list.class ul').each(function() {
+ $(this).addClass('collapsed').prev().addClass('collapsed');
+ });
+ $('#full_list.class').children().removeClass('collapsed');
+ highlight();
+}
+
+function highlight(no_padding) {
+ var n = 1;
+ $('#full_list li:visible').each(function() {
+ var next = n == 1 ? 2 : 1;
+ $(this).removeClass("r" + next).addClass("r" + n);
+ if (!no_padding && $('#full_list').hasClass('class')) {
+ $(this).css('padding-left', (10 + $(this).parents('ul').size() * 15) + 'px');
+ }
+ n = next;
+ });
+}
+
+function escapeShortcut() {
+ $(document).keydown(function(evt) {
+ if (evt.which == 27) {
+ $('#search_frame', window.top.document).slideUp(100);
+ $('#search a', window.top.document).removeClass('active inactive');
+ $(window.top).focus();
+ }
+ });
+}
+
+$(escapeShortcut);
+$(fullListSearch);
+$(linkList);
+$(collapse);
diff --git a/js/jquery.js b/js/jquery.js
new file mode 100644
index 00000000..198b3ff0
--- /dev/null
+++ b/js/jquery.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.1 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;ca ",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o=""+"",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
+f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c ",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML=" ",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="
";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
+{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>$2>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/
+
+
+
+
+ Method List
+
+
+
+
+
+
+
diff --git a/top-level-namespace.html b/top-level-namespace.html
new file mode 100644
index 00000000..0baf94af
--- /dev/null
+++ b/top-level-namespace.html
@@ -0,0 +1,114 @@
+
+
+
+
+
+ Top Level Namespace
+
+ — Documentation by YARD 0.8.7.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Top Level Namespace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Defined Under Namespace
+
+
+
+ Modules: ActionController , ActiveModel , ActiveModelSerializers , Grape , Rails
+
+
+
+ Classes: BulkCacheFetcher
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file