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
# 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)
    @auth = nil
    @videos = nil
    @streams = nil
    @audios = nil
    @audio_streams = 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

#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



138
139
140
141
# File 'lib/Ziggeo.rb', line 138

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

#applicationObject



108
109
110
111
# File 'lib/Ziggeo.rb', line 108

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

#audio_streamsObject



98
99
100
101
# File 'lib/Ziggeo.rb', line 98

def audio_streams()
    @audio_streams = @audio_streams || ZiggeoAudio_streams.new(self)
    return @audio_streams
end

#audiosObject



93
94
95
96
# File 'lib/Ziggeo.rb', line 93

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

#authObject



78
79
80
81
# File 'lib/Ziggeo.rb', line 78

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

#authtokensObject



103
104
105
106
# File 'lib/Ziggeo.rb', line 103

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

#effectProfileProcessObject



118
119
120
121
# File 'lib/Ziggeo.rb', line 118

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

#effectProfilesObject



113
114
115
116
# File 'lib/Ziggeo.rb', line 113

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

#metaProfileProcessObject



128
129
130
131
# File 'lib/Ziggeo.rb', line 128

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

#metaProfilesObject



123
124
125
126
# File 'lib/Ziggeo.rb', line 123

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

#streamsObject



88
89
90
91
# File 'lib/Ziggeo.rb', line 88

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

#videosObject



83
84
85
86
# File 'lib/Ziggeo.rb', line 83

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

#webhooksObject



133
134
135
136
# File 'lib/Ziggeo.rb', line 133

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