Class: Sorenson::ThreeSixty::RatePlan

Inherits:
Base
  • Object
show all
Defined in:
lib/sorenson/threesixty/rate_plan.rb

Constant Summary

Constants inherited from Base

Base::TOKEN_SALT

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

debug=, debug?, host, #post_to, post_to, protocol, token_for, use_ssl=, use_ssl?

Constructor Details

#initialize(data) ⇒ RatePlan

Instance Methods



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
# File 'lib/sorenson/threesixty/rate_plan.rb', line 32

def initialize(data)
  self.id                       = data['id']
  self.displayName              = data['displayName']
  self.ratePlanType             = data['ratePlanType']
  self.maxThumbnailsPerVideo    = data['maxThumbnailsPerVideo']
  self.setupCost                = data['setupCost']
  self.monthlyCost              = data['monthlyCost']
  self.annualCost               = data['annualCost']
  self.allowedStreams           = data['allowedStreams']
  self.basePlan                 = data['basePlan']
  self.dateLastModified         = data['dateLastModified']
  self.dateRetrieved            = data['dateRetrieved']
  self.streamingOverageAllowed  = data['streamingOverageAllowed']
  self.storageOverageAllowed    = data['storageOverageAllowed']
  self.allowedStreamingMBytes   = data['allowedStreamingMBytes']
  self.allowedStorageMBytes     = data['allowedStorageMBytes']
  self.allowedSourceMediaTypes  = data['allowedSourceMediaTypes'] # multi param
  self.allowedOutputMediaTypes  = data['allowedOutputMediaTypes'] # multi param
  self.sorensonSku              = data['sorensonSku']

  self.formatConstraints = []
  
  if data['formatConstraints']
    data['formatConstraints'].each do |f|
      self.formatConstraints << FormatConstraint.new(self, f)
    end
  end
end

Instance Attribute Details

#allowedOutputMediaTypesObject

Returns the value of attribute allowedOutputMediaTypes.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def allowedOutputMediaTypes
  @allowedOutputMediaTypes
end

#allowedSourceMediaTypesObject

Returns the value of attribute allowedSourceMediaTypes.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def allowedSourceMediaTypes
  @allowedSourceMediaTypes
end

#allowedStorageMBytesObject

Returns the value of attribute allowedStorageMBytes.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def allowedStorageMBytes
  @allowedStorageMBytes
end

#allowedStreamingMBytesObject

Returns the value of attribute allowedStreamingMBytes.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def allowedStreamingMBytes
  @allowedStreamingMBytes
end

#allowedStreamsObject

Returns the value of attribute allowedStreams.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def allowedStreams
  @allowedStreams
end

#annualCostObject

Returns the value of attribute annualCost.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def annualCost
  @annualCost
end

#basePlanObject

Returns the value of attribute basePlan.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def basePlan
  @basePlan
end

#dateLastModifiedObject

Returns the value of attribute dateLastModified.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def dateLastModified
  @dateLastModified
end

#dateRetrievedObject

Returns the value of attribute dateRetrieved.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def dateRetrieved
  @dateRetrieved
end

#displayNameObject

Returns the value of attribute displayName.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def displayName
  @displayName
end

#formatConstraintsObject

Returns the value of attribute formatConstraints.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def formatConstraints
  @formatConstraints
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def id
  @id
end

#maxThumbnailsPerVideoObject

Returns the value of attribute maxThumbnailsPerVideo.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def maxThumbnailsPerVideo
  @maxThumbnailsPerVideo
end

#monthlyCostObject

Returns the value of attribute monthlyCost.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def monthlyCost
  @monthlyCost
end

#ratePlanTypeObject

Returns the value of attribute ratePlanType.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def ratePlanType
  @ratePlanType
end

#setupCostObject

Returns the value of attribute setupCost.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def setupCost
  @setupCost
end

#sorensonSkuObject

Returns the value of attribute sorensonSku.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def sorensonSku
  @sorensonSku
end

#storageOverageAllowedObject

Returns the value of attribute storageOverageAllowed.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def storageOverageAllowed
  @storageOverageAllowed
end

#streamingOverageAllowedObject

Returns the value of attribute streamingOverageAllowed.



5
6
7
# File 'lib/sorenson/threesixty/rate_plan.rb', line 5

def streamingOverageAllowed
  @streamingOverageAllowed
end

Class Method Details

.getAllRatePlansObject



17
18
19
20
21
22
23
24
# File 'lib/sorenson/threesixty/rate_plan.rb', line 17

def self.getAllRatePlans
  data = post_to("/api/getAllRatePlans")
  rate_plans = []
  data['ratePlans'].each do |rate_plan|
    rate_plans << RatePlan.new(rate_plan)
  end
  rate_plans
end

.getBaseRatePlansObject

Class Methods



8
9
10
11
12
13
14
15
# File 'lib/sorenson/threesixty/rate_plan.rb', line 8

def self.getBaseRatePlans
  data = post_to('/api/getBaseRatePlans')
  rate_plans = []
  data['baseRatePlans'].each do |rate_plan|
    rate_plans << RatePlan.new(rate_plan)
  end
  rate_plans
end

.getRatePlan(id) ⇒ Object



26
27
28
29
# File 'lib/sorenson/threesixty/rate_plan.rb', line 26

def self.getRatePlan(id)
  data = post_to("/api/getRatePlan?ratePlanId=#{id}")
  RatePlan.new(data['ratePlanData'])
end