Class: Ziggeo

Inherits:
Object
  • Object
show all
Defined in:
lib/Ziggeo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token = nil, private_key = nil, encryption_key = nil) ⇒ Ziggeo

Returns a new instance of Ziggeo.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/Ziggeo.rb', line 26

def initialize(token = nil, private_key = nil, encryption_key = nil)
    @token = token
    @private_key = private_key
    @encryption_key = encryption_key
    @config = ZiggeoConfig.new()
    server_api_url = @config.server_api_url
    regions = @config.regions
    regions.each do |key, value|
        if (@token.start_with?(key))
            server_api_url = value
        end
    end
    @connect = ZiggeoConnect.new(self, server_api_url)
    api_url = @config.api_url
    api_regions = @config.api_regions
    api_regions.each do |key, value|
        if (@token.start_with?(key))
            api_url = value
        end
    end
    @api_connect = ZiggeoConnect.new(self, api_url)
    cdn_url = @config.cdn_url
    cdn_regions = @config.cdn_regions
    cdn_regions.each do |key, value|
        if (@token.start_with?(key))
            cdn_url = value
        end
    end
    @cdn_connect = ZiggeoConnect.new(self, cdn_url)
js_cdn_url = @config.js_cdn_url
js_cdn_regions = @config.js_cdn_regions
js_cdn_regions.each do |key, value|
		if (@token.start_with?(key))
				js_cdn_url = value
		end
end
@js_cdn_connect = ZiggeoConnect.new(self, js_cdn_url)
    @auth = nil
    @videos = nil
    @streams = nil
    @audios = nil
    @audioStreams = nil
    @authtokens = nil
    @application = nil
    @effectProfiles = nil
    @effectProfileProcess = nil
    @metaProfiles = nil
    @metaProfileProcess = nil
    @webhooks = nil
    @analytics = nil
    if (ENV["ZIGGEO_URL"] != nil)
        uri = URI.parse(ENV["ZIGGEO_URL"])
        @config.server_api_url = uri.scheme + "://" + uri.host + ":" + uri.port.to_s
        @token = uri.user
        @private_key = uri.password
        query = CGI::parse(uri.query)
        @encryption_key = query["encryption_key"]
    end
end

Instance Attribute Details

#api_connectObject

Returns the value of attribute api_connect.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def api_connect
  @api_connect
end

#cdn_connectObject

Returns the value of attribute cdn_connect.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def cdn_connect
  @cdn_connect
end

#configObject

Returns the value of attribute config.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def config
  @config
end

#connectObject

Returns the value of attribute connect.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def connect
  @connect
end

#encryption_keyObject

Returns the value of attribute encryption_key.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def encryption_key
  @encryption_key
end

#js_cdn_connectObject

Returns the value of attribute js_cdn_connect.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def js_cdn_connect
  @js_cdn_connect
end

#private_keyObject

Returns the value of attribute private_key.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def private_key
  @private_key
end

#tokenObject

Returns the value of attribute token.



24
25
26
# File 'lib/Ziggeo.rb', line 24

def token
  @token
end

Instance Method Details

#analyticsObject



146
147
148
149
# File 'lib/Ziggeo.rb', line 146

def analytics()
    @analytics = @analytics || ZiggeoAnalytics.new(self)
    return @analytics
end

#applicationObject



116
117
118
119
# File 'lib/Ziggeo.rb', line 116

def application()
    @application = @application || ZiggeoApplication.new(self)
    return @application
end

#audiosObject



101
102
103
104
# File 'lib/Ziggeo.rb', line 101

def audios()
    @audios = @audios || ZiggeoAudios.new(self)
    return @audios
end

#audioStreamsObject



106
107
108
109
# File 'lib/Ziggeo.rb', line 106

def audioStreams()
    @audioStreams = @audioStreams || ZiggeoAudioStreams.new(self)
    return @audioStreams
end

#authObject



86
87
88
89
# File 'lib/Ziggeo.rb', line 86

def auth()
    @auth = @auth || ZiggeoAuth.new(self)
    return @auth
end

#authtokensObject



111
112
113
114
# File 'lib/Ziggeo.rb', line 111

def authtokens()
    @authtokens = @authtokens || ZiggeoAuthtokens.new(self)
    return @authtokens
end

#effectProfileProcessObject



126
127
128
129
# File 'lib/Ziggeo.rb', line 126

def effectProfileProcess()
    @effectProfileProcess = @effectProfileProcess || ZiggeoEffectProfileProcess.new(self)
    return @effectProfileProcess
end

#effectProfilesObject



121
122
123
124
# File 'lib/Ziggeo.rb', line 121

def effectProfiles()
    @effectProfiles = @effectProfiles || ZiggeoEffectProfiles.new(self)
    return @effectProfiles
end

#metaProfileProcessObject



136
137
138
139
# File 'lib/Ziggeo.rb', line 136

def metaProfileProcess()
    @metaProfileProcess = @metaProfileProcess || ZiggeoMetaProfileProcess.new(self)
    return @metaProfileProcess
end

#metaProfilesObject



131
132
133
134
# File 'lib/Ziggeo.rb', line 131

def metaProfiles()
    @metaProfiles = @metaProfiles || ZiggeoMetaProfiles.new(self)
    return @metaProfiles
end

#streamsObject



96
97
98
99
# File 'lib/Ziggeo.rb', line 96

def streams()
    @streams = @streams || ZiggeoStreams.new(self)
    return @streams
end

#videosObject



91
92
93
94
# File 'lib/Ziggeo.rb', line 91

def videos()
    @videos = @videos || ZiggeoVideos.new(self)
    return @videos
end

#webhooksObject



141
142
143
144
# File 'lib/Ziggeo.rb', line 141

def webhooks()
    @webhooks = @webhooks || ZiggeoWebhooks.new(self)
    return @webhooks
end