Sha256: 36b672b5036741b95abd75a854b4428a3eb37ff953d6961cb6faf7f1931235c8

Contents?: true

Size: 659 Bytes

Versions: 7

Compression:

Stored size: 659 Bytes

Contents

module Pageflow
  class AudioFileUrlTemplates
    def call
      {
        original: url_template(:attachment, :original),
        m4a: url_template(:m4a),
        mp3: url_template(:mp3),
        ogg: url_template(:ogg),
        peak_data: url_template(:peak_data)
      }
    end

    private

    def url_template(attachment_name, *style)
      UrlTemplate.from_attachment(example_file.send(attachment_name), *style)
    end

    def example_file
      @example_file ||= AudioFile.new(id: 0,
                                      file_name: ':basename.:extension',
                                      peak_data_file_name: 'audio.json')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-17.0.4 app/models/pageflow/audio_file_url_templates.rb
pageflow-17.0.3 app/models/pageflow/audio_file_url_templates.rb
pageflow-17.0.2 app/models/pageflow/audio_file_url_templates.rb
pageflow-17.0.1 app/models/pageflow/audio_file_url_templates.rb
pageflow-17.0.0 app/models/pageflow/audio_file_url_templates.rb
pageflow-16.2.0 app/models/pageflow/audio_file_url_templates.rb
pageflow-16.1.0 app/models/pageflow/audio_file_url_templates.rb