Sha256: 35feae9c6409611f7f3237c32bad5578464f6f547ad9c5638569a9824997287c

Contents?: true

Size: 835 Bytes

Versions: 24

Compression:

Stored size: 835 Bytes

Contents

module MasterView
  module Directives

    class Text_field < MasterView::DirectiveBase
      def stag(dcs)
        #eat
      end

      def etag(dcs)
        args = parse_attr_value
        obj = args[0]
        method = args[1]

        obj = quote(obj) unless obj =~ /^:|'|"/
        method = quote(method) unless method =~ /^:|'|"/

        options = {}
        options[:size] = attrs_lck['size'].to_i if attrs_lck['size']
        options[:maxlength] = attrs_lck['maxlength'].to_i if attrs_lck['maxlength']
        options.merge! common_html_options(attrs_lck)
        remove_strings_from_attr_value!
        merge_hash_attr_value!(0, options)

        a = []
        a << 'text_field '+ obj
        a << method
        a << attr_value unless attr_value.strip.empty?
        erb_content(a.join(', '))
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
masterview-0.0.11 lib/masterview/directives/text_field.rb
masterview-0.0.13 lib/masterview/directives/text_field.rb
masterview-0.0.14 lib/masterview/directives/text_field.rb
masterview-0.0.15 lib/masterview/directives/text_field.rb
masterview-0.0.16 lib/masterview/directives/text_field.rb
masterview-0.0.17 lib/masterview/directives/text_field.rb
masterview-0.0.2 lib/masterview/directives/text_field.rb
masterview-0.0.12 lib/masterview/directives/text_field.rb
masterview-0.0.10 lib/masterview/directives/text_field.rb
masterview-0.1.0 lib/masterview/directives/text_field.rb
masterview-0.0.9 lib/masterview/directives/text_field.rb
masterview-0.0.7 lib/masterview/directives/text_field.rb
masterview-0.1.5 lib/masterview/directives/text_field.rb
masterview-0.2.0 lib/masterview/directives/text_field.rb
masterview-0.2.1 lib/masterview/directives/text_field.rb
masterview-0.1.3 lib/masterview/directives/text_field.rb
masterview-0.1.2 lib/masterview/directives/text_field.rb
masterview-0.1.1 lib/masterview/directives/text_field.rb
masterview-0.0.8 lib/masterview/directives/text_field.rb
masterview-0.2.2 lib/masterview/directives/text_field.rb