lib/hungryform/elements.rb in hungryform-0.0.4 vs lib/hungryform/elements.rb in hungryform-0.0.6
- old
+ new
@@ -1,7 +1,15 @@
module HungryForm
module Elements
+ # Find a class of the Elements module by name
+ def self.find_class(name)
+ constants.find { |c| Class === const_get(c) && c.to_s.underscore.to_sym == name }
+ end
+
+ def self.all_classes
+ constants.select { |c| Class === const_get(c) }
+ end
end
end
require_relative 'elements/base/hashable'
require_relative 'elements/base/element'
@@ -11,7 +19,7 @@
require_relative 'elements/page'
require_relative 'elements/group'
require_relative 'elements/html'
require_relative 'elements/text_field'
require_relative 'elements/select_field'
-require_relative 'elements/text_area_field'
+require_relative 'elements/text_area'
require_relative 'elements/radio_group'