Class: UserChoices::ChoiceCheckingConversion
- Inherits:
-
Conversion
- Object
- Conversion
- UserChoices::ChoiceCheckingConversion
- Defined in:
- lib/user-choices/conversions.rb
Overview
Note: since some of the above classes are described_by? methods that respond_to :include, this class should be last, so that it’s checked last.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Conversion
#convert, #does_length_check?, for, inherited, #initialize, is_abstract, record_for
Constructor Details
This class inherits a constructor from UserChoices::Conversion
Class Method Details
.described_by?(conversion_tag) ⇒ Boolean
:nodoc:
156 157 158 |
# File 'lib/user-choices/conversions.rb', line 156 def self.described_by?(conversion_tag) conversion_tag.respond_to?(:include?) end |
Instance Method Details
#description ⇒ Object
161 |
# File 'lib/user-choices/conversions.rb', line 161 def description; "one of #{friendly_list('or', @conversion_tag)}"; end |
#suitable?(actual) ⇒ Boolean
160 |
# File 'lib/user-choices/conversions.rb', line 160 def suitable?(actual); @conversion_tag.include?(actual); end |