Sha256: f341f84f044d96c2dbe06a0a22ea62e1e708e161bfc068105b29925831021fd5

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

class SmartAppBannerHelperStub
  include Rails::SmartAppBanner::Helper

  def smart_app_banner(id, options = {})
    unless id
      raise AppIDNotDefined
    end

    app_id = "app-id=#{ id }"

    if options[:affiliate_data].nil?
      affiliate_data = nil
    else
      affiliate_data = "affiliate-data=#{ options[:affiliate_data] }"
    end

    if options[:app_argument].nil?
      app_argument = nil
    else
      app_argument = "app-argument=#{ options[:app_argument] }"
    end

    metadata = [app_id, affiliate_data, app_argument].
      delete_if(&:nil?).
      join(', ')

    output = "<meta name=\"apple-itunes-app\" content=\"#{ metadata }\">"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smart-app-banner-0.0.2 spec/stub.rb
smart-app-banner-0.0.1 spec/stub.rb