lib/contentful/file.rb in contentful-1.2.2 vs lib/contentful/file.rb in contentful-2.0.0
- old
+ new
@@ -1,13 +1,12 @@
-require_relative 'resource'
-
module Contentful
# An Assets's file info
class File
- include Contentful::Resource
-
- property :fileName, :string
- property :contentType, :string
- property :details
- property :url, :string
+ attr_reader :file_name, :content_type, :details, :url
+ def initialize(json)
+ @file_name = json.fetch('fileName', nil)
+ @content_type = json.fetch('contentType', nil)
+ @details = json.fetch('details', nil)
+ @url = json.fetch('url', nil)
+ end
end
end