class Attrio::Types::Symbol

Public Class Methods

typecast(value, options = {}) click to toggle source
# File lib/attrio/types/symbol.rb, line 6
def self.typecast(value, options = {})
  begin
    value = value.underscore if options[:underscore].present?
    value.to_sym
  rescue NoMethodError => e
    nil
  end
end
typecasted?(value, options = {}) click to toggle source
# File lib/attrio/types/symbol.rb, line 15
def self.typecasted?(value, options = {})
  value.is_a? ::Symbol
end