class Bh::Classes::Cdn

@api private

Public Class Methods

bootstrap(options = {}) click to toggle source

@note if unspecified, the version should match the latest available

version. If that's not the case, it's a bug and should be fixed.
# File lib/bh/classes/cdn.rb, line 9
def self.bootstrap(options = {})
  options[:version] ||= '3.3.6'
  cdn_asset options.merge(library: 'bootstrap')
end
font_awesome(options = {}) click to toggle source

@note if unspecified, the version should match the latest available

version. If that's not the case, it's a bug and should be fixed.
# File lib/bh/classes/cdn.rb, line 16
def self.font_awesome(options = {})
  options[:version] ||= '4.5.0'
  cdn_asset options.merge(library: 'font-awesome')
end

Private Class Methods

cdn_asset(options = {}) click to toggle source
# File lib/bh/classes/cdn.rb, line 23
def self.cdn_asset(options = {})
  version = options[:version]
  extension = options[:extension]
  name = options[:name]
  name = "#{name}.min" if options.fetch(:minified, true)
  library = options[:library]
  scheme = "#{options[:scheme]}:" if options[:scheme]
  host = "#{scheme}//netdna.bootstrapcdn.com"
  "#{host}/#{library}/#{version}/#{extension}/#{name}.#{extension}"
end