Sha256: 3c0586485df25a67ea02c5dd8dc56967cd8fbc188d722d1599785581a33365c9

Contents?: true

Size: 452 Bytes

Versions: 4

Compression:

Stored size: 452 Bytes

Contents

module Vapid
  module Directives
    # Text directive
    class Text < Vapid::Directive
      # Render
      renders :text do |input|
        input.to_s unless input.blank?
      end

      filter :before do |input, prefix|
        "#{prefix}#{input}"
      end

      filter :after do |input, suffix|
        "#{input}#{suffix}"
      end

      # Form
      form do |name, value|
        text_field_tag name, value: value
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vapid-0.1.3 lib/vapid/directives/text.rb
vapid-0.1.2 lib/vapid/directives/text.rb
vapid-0.1.1 lib/vapid/directives/text.rb
vapid-0.1.0 lib/vapid/directives/text.rb