Class: Passbook::Manifest
- Inherits:
-
Object
- Object
- Passbook::Manifest
- Defined in:
- lib/passbook/manifest.rb
Instance Method Summary collapse
- #content ⇒ Object
- #dictionary ⇒ Object
- #filename ⇒ Object
-
#initialize(*files) ⇒ Manifest
constructor
A new instance of Manifest.
Constructor Details
#initialize(*files) ⇒ Manifest
Returns a new instance of Manifest.
6 7 8 |
# File 'lib/passbook/manifest.rb', line 6 def initialize(*files) @files = files.flatten.compact end |
Instance Method Details
#content ⇒ Object
14 15 16 |
# File 'lib/passbook/manifest.rb', line 14 def content @content ||= dictionary.to_json end |
#dictionary ⇒ Object
18 19 20 21 22 |
# File 'lib/passbook/manifest.rb', line 18 def dictionary @files.each_with_object({}) do |file, dict| dict[file.filename] = Digest::SHA1.hexdigest(file.content) end end |
#filename ⇒ Object
10 11 12 |
# File 'lib/passbook/manifest.rb', line 10 def filename "manifest.json" end |