Sha256: f7247478f2dccebbf630c210753ee6bdfcaf37aa6a31fab59de495a237b5d9ab

Contents?: true

Size: 693 Bytes

Versions: 21

Compression:

Stored size: 693 Bytes

Contents

require 'securerandom'

module BjondApi
  class BjondAppDefinition
    attr_accessor :id, :author, :name, :description, :rootEndpoint, :configURL, :iconURL, :rootEndpoint, :integrationEvent, :integrationConsequence

    def initialize()
      self.id = SecureRandom.uuid
      self.configURL    = "#{self.get_hostname}/bjond-app/services"
      self.rootEndpoint = "#{self.get_hostname}/bjond-app/services"
      self.integrationEvent = []
      self.integrationConsequence = []
    end

    def get_hostname()
      Rails.application.config.action_controller.default_url_options ? Rails.application.config.action_controller.default_url_options[:root_url] : nil || `hostname`
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
bjond-api-1.1.0 lib/bjond-app-definition.rb
bjond-api-1.0.0 lib/bjond-app-definition.rb
bjond-api-0.4.0 lib/bjond-app-definition.rb
bjond-api-0.3.13 lib/bjond-app-definition.rb
bjond-api-0.3.12 lib/bjond-app-definition.rb
bjond-api-0.3.11 lib/bjond-app-definition.rb
bjond-api-0.3.10 lib/bjond-app-definition.rb
bjond-api-0.3.9 lib/bjond-app-definition.rb
bjond-api-0.3.6 lib/bjond-app-definition.rb
bjond-api-0.3.5 lib/bjond-app-definition.rb
bjond-api-0.3.4 lib/bjond-app-definition.rb
bjond-api-0.3.3 lib/bjond-app-definition.rb
bjond-api-0.3.2 lib/bjond-app-definition.rb
bjond-api-0.3.1 lib/bjond-app-definition.rb
bjond-api-0.3.0 lib/bjond-app-definition.rb
bjond-api-0.2.6 lib/bjond-app-definition.rb
bjond-api-0.2.5 lib/bjond-app-definition.rb
bjond-api-0.2.4 lib/bjond-app-definition.rb
bjond-api-0.2.3 lib/bjond-app-definition.rb
bjond-api-0.2.2 lib/bjond-app-definition.rb