Class: Restful::ApiModel::Collection
- Defined in:
- lib/restful/apimodel/collection.rb
Instance Attribute Summary collapse
-
#total_entries ⇒ Object
Returns the value of attribute total_entries.
Attributes inherited from Attribute
#extended_type, #name, #type, #value
Instance Method Summary collapse
-
#initialize(name, resources, extended_type) ⇒ Collection
constructor
A new instance of Collection.
-
#serialize(type) ⇒ Object
invoke serialization.
Constructor Details
#initialize(name, resources, extended_type) ⇒ Collection
Returns a new instance of Collection.
9 10 11 12 13 |
# File 'lib/restful/apimodel/collection.rb', line 9 def initialize(name, resources, extended_type) super self.type = :collection end |
Instance Attribute Details
#total_entries ⇒ Object
Returns the value of attribute total_entries.
7 8 9 |
# File 'lib/restful/apimodel/collection.rb', line 7 def total_entries @total_entries end |
Instance Method Details
#serialize(type) ⇒ Object
invoke serialization
16 17 18 19 |
# File 'lib/restful/apimodel/collection.rb', line 16 def serialize(type) serializer = Restful::Serializers::Base.serializer(type) serializer.serialize(self) end |