Sha256: 539e77c45b2bd345e08288094c68644a18dcd7db5f28e86deb43f94e922ddd78

Contents?: true

Size: 591 Bytes

Versions: 1

Compression:

Stored size: 591 Bytes

Contents

module StorageRoom
  class Collection < Model        
    class << self                  
      def index_path
        '/collections'
      end
      
      def show_path(collection_id)
        "#{index_path}/#{collection_id}"
      end
      
      def resources_path(collection_id)
        "#{show_path(collection_id)}/resources"
      end
      
      def json_name
        'collection'
      end
    end
    
    def resources
      Array.load(self[:@resources_url])
    end
    
    def resource_class
      StorageRoom.class_for_name(self[:identifier].classify)
    end

    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
storage_room-0.1.0 lib/storage_room/models/collection.rb