Class: Magiq::Types::EnumSort

Inherits:
Type
  • Object
show all
Defined in:
lib/magiq/types.rb

Instance Attribute Summary

Attributes inherited from Type

#raw

Instance Method Summary collapse

Methods inherited from Type

cast, #initialize

Constructor Details

This class inherits a constructor from Magiq::Types::Type

Instance Method Details

#cast!Object



188
189
190
191
192
193
194
195
196
197
198
# File 'lib/magiq/types.rb', line 188

def cast!
  case raw.downcase
  when 'asc'
    :asc
  when 'desc'
    :desc
  else
    bad! "provided value of #{raw.inspect} is not permitted, permitted " \
    "values are: \"asc\", or \"desc\""
  end
end