Sha256: 5695282564cb5c794da5287663ea83b8793b78045690d06c7205206c706f795a

Contents?: true

Size: 639 Bytes

Versions: 3

Compression:

Stored size: 639 Bytes

Contents

module Syncano
  class API

    def initialize(connection)
      self.connection = connection

      self.class.initialize(connection) unless self.class.initialized?
    end

    class << self
      def initialize(connection)
        endpoints = Schema::EndpointsWhitelist.new(Schema.new(connection))

        resources_definitions = Resources.build_definitions(endpoints)

        include Syncano::API::Endpoints.definition(resources_definitions)

        self.initialized = true
      end

      def initialized?
        initialized
      end
    end

    private

    attr_accessor :connection
    cattr_accessor :initialized
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
syncano-4.0.0.alpha4 lib/syncano/api.rb
syncano-4.0.0.alpha3 lib/syncano/api.rb
syncano-4.0.0.alpha2 lib/syncano/api.rb