Sha256: 29c733a00f05a0f1ac7c3435baeb85ba397eee728c3d593a15d41def76e0d5ff

Contents?: true

Size: 1.21 KB

Versions: 9

Compression:

Stored size: 1.21 KB

Contents

module PlateApi::PlateObject
  class Site < Base

    has_one :theme, "PlateApi::PlateObject::Theme"
    has_one :company, "PlateApi::PlateObject::Company"
    has_many :site_translations, :site_translation, "PlateApi::PlateObject::SiteTranslation"
    has_many :posts, :post, "PlateApi::PlateObject::Post"
    has_many :sections, :section, "PlateApi::PlateObject::Section"
    has_many :rows, :row, "PlateApi::PlateObject::Row"
    has_many :columns, :column, "PlateApi::PlateObject::Column"
    has_many :elements, :element, "PlateApi::PlateObject::Element"
    has_many :content_objects, :content_object, "PlateApi::PlateObject::ContentObject"
    has_many :attachment_folders, :attachment_folder, "PlateApi::PlateObject::AttachmentFolder"
    has_many :attachments, :attachment, "PlateApi::PlateObject::Attachment"

    def self.api_name
      "sites"
    end

    def self.parent_class
      Company
    end

    def create_attachment(file, extra_parameters={})
      raise ArgumentError.new("No File is given as input") unless file.is_a? File
      parameters = extra_parameters.merge({file: file})
      @object_handler.api_connector.handler(PlateApi::PlateObject::Attachment).create(self, parameters, :post_multipart)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
plate_api-1.2.8 lib/plate_api/plate_object/site.rb
plate_api-1.2.7 lib/plate_api/plate_object/site.rb
plate_api-1.2.6 lib/plate_api/plate_object/site.rb
plate_api-1.2.5 lib/plate_api/plate_object/site.rb
plate_api-1.2.4 lib/plate_api/plate_object/site.rb
plate_api-1.2.2 lib/plate_api/plate_object/site.rb
plate_api-1.2.0 lib/plate_api/plate_object/site.rb
plate_api-1.1.8 lib/plate_api/plate_object/site.rb
plate_api-1.1.7 lib/plate_api/plate_object/site.rb