lib/npr/entity/permissions.rb in npr-1.1.0 vs lib/npr/entity/permissions.rb in npr-1.2.0
- old
+ new
@@ -5,14 +5,27 @@
#
module NPR
module Entity
class Permissions < Base
attr_accessor :download, :stream, :embed
-
+
def initialize(json)
@download = json["download"]["allow"] == "true" if json["download"]
@stream = json["stream"]["allow"] == "true" if json["stream"]
@embed = json["embed"]["allow"] == "true" if json["embed"]
+ end
+
+
+ def download?
+ !!@download
+ end
+
+ def stream?
+ !!@stream
+ end
+
+ def embed?
+ !!@embed
end
end
end
end