Sha256: cd25db59bf011233a208e981ee57937533f7b56491c98dce80c87c12a86834c6

Contents?: true

Size: 343 Bytes

Versions: 25

Compression:

Stored size: 343 Bytes

Contents

require 'active_support/core_ext/string/output_safety'
module HoboFields
  module Types
    class Text < String

      COLUMN_TYPE = :text

      def to_html(xmldoctype = true)
        ERB::Util.html_escape(self).gsub("\n", "<br#{xmldoctype ? ' /' : ''}>\n").html_safe
      end

      HoboFields.register_type(:text, self)

    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hobo_fields-2.0.1 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre10 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre9 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre8 lib/hobo_fields/types/text.rb
hobo_fields-1.3.3 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre7 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre6 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre5 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre4 lib/hobo_fields/types/text.rb
hobo_fields-1.3.2 lib/hobo_fields/types/text.rb
hobo_fields-1.3.1 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre3 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre2 lib/hobo_fields/types/text.rb
hobo_fields-2.0.0.pre1 lib/hobo_fields/types/text.rb
hobo_fields-1.4.0.pre8 lib/hobo_fields/types/text.rb
hobo_fields-1.4.0.pre7 lib/hobo_fields/types/text.rb
hobo_fields-1.4.0.pre6 lib/hobo_fields/types/text.rb
hobo_fields-1.4.0.pre5 lib/hobo_fields/types/text.rb
hobo_fields-1.4.0.pre4 lib/hobo_fields/types/text.rb