Class: Spaceship::ConnectAPI::AgeRatingDeclaration
- Inherits:
-
Object
- Object
- Spaceship::ConnectAPI::AgeRatingDeclaration
- Includes:
- Model
- Defined in:
- spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb
Defined Under Namespace
Constant Summary collapse
- LEGACY_AGE_RATING_ITC_MAP =
{ "CARTOON_FANTASY_VIOLENCE" => "violenceCartoonOrFantasy", "REALISTIC_VIOLENCE" => "violenceRealistic", "PROLONGED_GRAPHIC_SADISTIC_REALISTIC_VIOLENCE" => "violenceRealisticProlongedGraphicOrSadistic", "PROFANITY_CRUDE_HUMOR" => "profanityOrCrudeHumor", "MATURE_SUGGESTIVE" => "matureOrSuggestiveThemes", "HORROR" => "horrorOrFearThemes", "MEDICAL_TREATMENT_INFO" => "medicalOrTreatmentInformation", "ALCOHOL_TOBACCO_DRUGS" => "alcoholTobaccoOrDrugUseOrReferences", "GAMBLING" => "gamblingSimulated", "SEXUAL_CONTENT_NUDITY" => "sexualContentOrNudity", "GRAPHIC_SEXUAL_CONTENT_NUDITY" => "sexualContentGraphicAndNudity", "UNRESTRICTED_WEB_ACCESS" => "unrestrictedWebAccess", "GAMBLING_CONTESTS" => "gamblingAndContests" }
- LEGACY_RATING_VALUE_ITC_MAP =
{ 0 => Rating::NONE, 1 => Rating::INFREQUENT_OR_MILD, 2 => Rating::FREQUENT_OR_INTENSE }
- LEGACY_BOOLEAN_VALUE_ITC_MAP =
{ 0 => false, 1 => true }
Instance Attribute Summary collapse
-
#alcohol_tobacco_or_drug_use_or_references ⇒ Object
Rating.
-
#gambling_and_contests ⇒ Object
boolean.
-
#gambling_simulated ⇒ Object
Returns the value of attribute gambling_simulated.
-
#horror_or_fear_themes ⇒ Object
Returns the value of attribute horror_or_fear_themes.
-
#kids_age_band ⇒ Object
KidsAge.
-
#mature_or_suggestive_themes ⇒ Object
Returns the value of attribute mature_or_suggestive_themes.
-
#medical_or_treatment_information ⇒ Object
Returns the value of attribute medical_or_treatment_information.
-
#profanity_or_crude_humor ⇒ Object
Returns the value of attribute profanity_or_crude_humor.
-
#sexual_content_graphic_and_nudity ⇒ Object
Returns the value of attribute sexual_content_graphic_and_nudity.
-
#unrestricted_web_access ⇒ Object
Returns the value of attribute unrestricted_web_access.
-
#violence_cartoon_or_fantasy ⇒ Object
Returns the value of attribute violence_cartoon_or_fantasy.
-
#violence_realistic ⇒ Object
Returns the value of attribute violence_realistic.
-
#violence_realistic_prolonged_graphic_or_sadistic ⇒ Object
Returns the value of attribute violence_realistic_prolonged_graphic_or_sadistic.
Attributes included from Model
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Model
#attr_mapping, included, #initialize, #to_json, #update_attributes
Instance Attribute Details
permalink #alcohol_tobacco_or_drug_use_or_references ⇒ Object
Rating
8 9 10 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 8 def alcohol_tobacco_or_drug_use_or_references @alcohol_tobacco_or_drug_use_or_references end |
permalink #gambling_and_contests ⇒ Object
boolean
20 21 22 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 20 def gambling_and_contests @gambling_and_contests end |
permalink #gambling_simulated ⇒ Object
Returns the value of attribute gambling_simulated.
9 10 11 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 9 def gambling_simulated @gambling_simulated end |
permalink #horror_or_fear_themes ⇒ Object
Returns the value of attribute horror_or_fear_themes.
13 14 15 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 13 def horror_or_fear_themes @horror_or_fear_themes end |
permalink #kids_age_band ⇒ Object
KidsAge
24 25 26 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 24 def kids_age_band @kids_age_band end |
permalink #mature_or_suggestive_themes ⇒ Object
Returns the value of attribute mature_or_suggestive_themes.
14 15 16 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 14 def mature_or_suggestive_themes @mature_or_suggestive_themes end |
permalink #medical_or_treatment_information ⇒ Object
Returns the value of attribute medical_or_treatment_information.
10 11 12 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 10 def medical_or_treatment_information @medical_or_treatment_information end |
permalink #profanity_or_crude_humor ⇒ Object
Returns the value of attribute profanity_or_crude_humor.
11 12 13 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 11 def profanity_or_crude_humor @profanity_or_crude_humor end |
permalink #sexual_content_graphic_and_nudity ⇒ Object
Returns the value of attribute sexual_content_graphic_and_nudity.
12 13 14 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 12 def sexual_content_graphic_and_nudity @sexual_content_graphic_and_nudity end |
permalink #unrestricted_web_access ⇒ Object
Returns the value of attribute unrestricted_web_access.
21 22 23 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 21 def unrestricted_web_access @unrestricted_web_access end |
permalink #violence_cartoon_or_fantasy ⇒ Object
Returns the value of attribute violence_cartoon_or_fantasy.
15 16 17 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 15 def violence_cartoon_or_fantasy @violence_cartoon_or_fantasy end |
permalink #violence_realistic ⇒ Object
Returns the value of attribute violence_realistic.
17 18 19 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 17 def violence_realistic @violence_realistic end |
permalink #violence_realistic_prolonged_graphic_or_sadistic ⇒ Object
Returns the value of attribute violence_realistic_prolonged_graphic_or_sadistic.
16 17 18 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 16 def violence_realistic_prolonged_graphic_or_sadistic @violence_realistic_prolonged_graphic_or_sadistic end |
Class Method Details
permalink .map_key_from_itc(key) ⇒ Object
[View source]
86 87 88 89 90 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 86 def self.map_key_from_itc(key) key = key.gsub("MZGenre.", "") return nil if key.empty? LEGACY_AGE_RATING_ITC_MAP[key] || key end |
permalink .map_value_from_itc(key, value) ⇒ Object
[View source]
92 93 94 95 96 97 98 99 100 101 102 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 92 def self.map_value_from_itc(key, value) if ["gamblingAndContests", "unrestrictedWebAccess"].include?(key) new_value = LEGACY_BOOLEAN_VALUE_ITC_MAP[value] return value if new_value.nil? return new_value else return LEGACY_RATING_VALUE_ITC_MAP[value] || value end return value end |
permalink .type ⇒ Object
[View source]
55 56 57 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 55 def self.type return "ageRatingDeclarations" end |
Instance Method Details
permalink #update(attributes: nil) ⇒ Object
API
108 109 110 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 108 def update(attributes: nil) Spaceship::ConnectAPI.(age_rating_declaration_id: id, attributes: attributes) end |