Class: HumanizableString

Inherits:
String
  • Object
show all
Defined in:
lib/assignable_values/humanizable_string.rb

Overview

A String that responds to #humanized. Earlier versions of assignable_values dependent on such an API.

Instance Method Summary collapse

Constructor Details

#initialize(string, humanization) ⇒ HumanizableString

Returns a new instance of HumanizableString.



5
6
7
8
# File 'lib/assignable_values/humanizable_string.rb', line 5

def initialize(string, humanization)
  super(string)
  @humanization = humanization
end

Instance Method Details

#humanizedObject



10
11
12
13
# File 'lib/assignable_values/humanizable_string.rb', line 10

def humanized
  ActiveSupport::Deprecation.warn("assignable_<value>.humanized is deprecated, use humanized_assignable_<value>s.humanized instead", caller)
  @humanization
end