Sha256: d60f2148982722ae226fca7d6f4949516eadda5f96845dcceb77376d00fb13c9

Contents?: true

Size: 789 Bytes

Versions: 3

Compression:

Stored size: 789 Bytes

Contents

module MasterView
  module Directives

    # create check_box helper, quoting object and method if necessary
    # merging in any html options specified
    class Check_box < MasterView::DirectiveBase
      def stag(dcs)
        #eat
      end

      def etag(dcs)
        args = parse_attr_value
        obj = args[0]
        method = args[1]
        options_and_on_off = args[2..-1].join(', ')

        obj = quote_if(obj)
        method = quote_if(method)

        options_and_on_off = merge_into_embedded_hash(options_and_on_off, 0, common_html_options(attrs_lck))

        a = []
        a << 'check_box '+ obj
        a << method
        a << options_and_on_off if options_and_on_off && !options_and_on_off.strip.empty?
        erb_content(a.join(', '))
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
masterview-0.2.3 lib/masterview/directives/check_box.rb
masterview-0.2.4 lib/masterview/directives/check_box.rb
masterview-0.2.5 lib/masterview/directives/check_box.rb