class Clever::Types::Base

Public Instance Methods

blank?(field) click to toggle source
# File lib/clever/types/base.rb, line 18
def blank?(field)
  field.nil? || field == ''
end
presence(field) click to toggle source
# File lib/clever/types/base.rb, line 14
def presence(field)
  field unless blank?(field)
end
to_h() click to toggle source
# File lib/clever/types/base.rb, line 6
def to_h
  instance_variables.each_with_object({}) do |instance_var, variables|
    key = instance_var.to_s.tr('@', '').to_sym
    value = instance_variable_get(instance_var)
    variables[key] = value
  end
end