Sha256: ff3bdb61608d89ce43e6a9e9a37039229a376dc845994132591c634caa5d27ee

Contents?: true

Size: 420 Bytes

Versions: 15

Compression:

Stored size: 420 Bytes

Contents

# encoding: UTF-8

module Spontaneous::Output::Helpers
  module ClassesHelper
    extend self

    def classes(*args)
      args = args.flatten
      optional = args.extract_options!
      optional.each do |class_name, active|
        args << class_name if active
      end
      return "" if args.empty?
      %(class="#{args.join(" ")}")
    end
    Spontaneous::Output::Helpers.register_helper(self, :html)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta9 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta8 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta7 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta6 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta5 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta4 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta3 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta2 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.beta1 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.alpha7 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/output/helpers/classes_helper.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/output/helpers/classes_helper.rb