Sha256: 577d61f850a1d7521ae2cb5a55afe59cedcce6bc650d760d2e7241d1312c8dce

Contents?: true

Size: 724 Bytes

Versions: 46

Compression:

Stored size: 724 Bytes

Contents

class Ey::Core::Client::Application < Ey::Core::Model
  extend Ey::Core::Associations

  identity :id, type: :integer

  attribute :language
  attribute :name
  attribute :repository
  attribute :type

  has_one :account

  has_many :archives, key: :application_archives
  has_many :keypairs

  def save!
    params = {
      "url"         => self.collection.url,
      "account"     => self.account_id,
      "application" => {
        "name"       => self.name,
        "type"       => self.type,
        "repository" => self.repository,
      },
    }

    if new_record?
      merge_attributes(self.connection.create_application(params).body["application"])
    else raise NotImplementedError # update
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
ey-core-3.4.4 lib/ey-core/models/application.rb
ey-core-3.4.2 lib/ey-core/models/application.rb
ey-core-3.4.1 lib/ey-core/models/application.rb
ey-core-3.4.0 lib/ey-core/models/application.rb
ey-core-3.3.1 lib/ey-core/models/application.rb
ey-core-3.3.0 lib/ey-core/models/application.rb
ey-core-3.2.6 lib/ey-core/models/application.rb
ey-core-3.2.5 lib/ey-core/models/application.rb
ey-core-3.2.4 lib/ey-core/models/application.rb
ey-core-3.2.3 lib/ey-core/models/application.rb
ey-core-3.2.2 lib/ey-core/models/application.rb
ey-core-3.2.1 lib/ey-core/models/application.rb
ey-core-3.2.0 lib/ey-core/models/application.rb
ey-core-3.1.11 lib/ey-core/models/application.rb
ey-core-3.1.10 lib/ey-core/models/application.rb
ey-core-3.1.9 lib/ey-core/models/application.rb
ey-core-3.1.8 lib/ey-core/models/application.rb
ey-core-3.1.7 lib/ey-core/models/application.rb
ey-core-3.1.6 lib/ey-core/models/application.rb
ey-core-3.1.5 lib/ey-core/models/application.rb