module HumanAttributes::Config

Constants

TYPES

Public Instance Methods

category_by_type(type) click to toggle source
# File lib/human_attributes/config.rb, line 73
def category_by_type(type)
  type_config(type)[:category]
end
formatter_by_type(type) click to toggle source
# File lib/human_attributes/config.rb, line 77
def formatter_by_type(type)
  type_config(type)[:formatter]
end
known_type?(type) click to toggle source
# File lib/human_attributes/config.rb, line 85
def known_type?(type)
  !!type_config(type)
end
raise_error(error_class) click to toggle source
# File lib/human_attributes/config.rb, line 93
def raise_error(error_class)
  raise "HumanAttributes::Error::#{error_class}".constantize.new
end
suffix_by_type(type) click to toggle source
# File lib/human_attributes/config.rb, line 81
def suffix_by_type(type)
  type_config(type)[:suffix]
end
type_config(type) click to toggle source
# File lib/human_attributes/config.rb, line 89
def type_config(type)
  TYPES.select { |t| t[:name] == type }.first
end