Sha256: aad1a2fdcf628ee0a04e9c3cea431639189f4b083c7c76c3f9f4cbeb111bdfbf

Contents?: true

Size: 703 Bytes

Versions: 2

Compression:

Stored size: 703 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    = "http://#{self.get_hostname}/bjond-app/services"
      self.rootEndpoint = "http://#{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[:host] : nil || `hostname`
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bjond-api-0.2.0 lib/bjond-app-definition.rb
bjond-api-0.1.5 lib/bjond-app-definition.rb