Sha256: b09cc2a40c37d38d799be14d45d978acd8980f0179dc1e5d164d77bcbae9a0fd

Contents?: true

Size: 972 Bytes

Versions: 3

Compression:

Stored size: 972 Bytes

Contents

module Cello
  module Structure
    module TextareaHelper
      def define_extras_for_textarea(name)
        define_method "#{name}_is_enable?" do
          !(send(name).disabled?)
        end
        define_method "#{name}_clear" do
          send(name).clear
        end
        define_method "#{name}_get_text" do
          send(name).value
        end
        define_method "#{name}_fill_with" do |text|
          send(name).set text
        end
        define_method "#{name}_dont_contain" do |text|
          !(send(name).value.include? text)
        end
        define_method "#{name}_contains" do |text|
          send(name).value.include? text
        end
        define_method "#{name}_text_is" do |text|
          send(name).value == text
        end
        define_method "#{name}_is_empty?" do 
          send(name).value.empty?
        end
        define_method "#{name}_text_size" do 
          send(name).value.size
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cello-0.0.19 lib/cello/structure/html_elements/textarea_helper.rb
cello-0.0.17 lib/cello/structure/html_elements/textarea_helper.rb
cello-0.0.16 lib/cello/structure/html_elements/textarea_helper.rb