Class: NPR::Entity::Permissions
- Defined in:
- lib/npr/entity/permissions.rb
Instance Attribute Summary collapse
-
#download ⇒ Object
Returns the value of attribute download.
-
#embed ⇒ Object
Returns the value of attribute embed.
-
#stream ⇒ Object
Returns the value of attribute stream.
Instance Method Summary collapse
- #download? ⇒ Boolean
- #embed? ⇒ Boolean
-
#initialize(json) ⇒ Permissions
constructor
A new instance of Permissions.
- #stream? ⇒ Boolean
Methods included from Concern::ShallowAttributes
Methods included from Concern::Relation
Constructor Details
#initialize(json) ⇒ Permissions
Returns a new instance of Permissions.
11 12 13 14 15 |
# File 'lib/npr/entity/permissions.rb', line 11 def initialize(json) @download = json["download"]["allow"] == "true" if json["download"] @stream = json["stream"]["allow"] == "true" if json["stream"] = json["embed"]["allow"] == "true" if json["embed"] end |
Instance Attribute Details
#download ⇒ Object
Returns the value of attribute download.
9 10 11 |
# File 'lib/npr/entity/permissions.rb', line 9 def download @download end |
#embed ⇒ Object
Returns the value of attribute embed.
9 10 11 |
# File 'lib/npr/entity/permissions.rb', line 9 def end |
#stream ⇒ Object
Returns the value of attribute stream.
9 10 11 |
# File 'lib/npr/entity/permissions.rb', line 9 def stream @stream end |
Instance Method Details
#download? ⇒ Boolean
18 19 20 |
# File 'lib/npr/entity/permissions.rb', line 18 def download? !!@download end |
#embed? ⇒ Boolean
26 27 28 |
# File 'lib/npr/entity/permissions.rb', line 26 def !! end |
#stream? ⇒ Boolean
22 23 24 |
# File 'lib/npr/entity/permissions.rb', line 22 def stream? !!@stream end |