Class: HstoreRadioButtons::Formatter
- Inherits:
-
Object
- Object
- HstoreRadioButtons::Formatter
- Defined in:
- lib/hstore_radio_buttons/formatter.rb
Instance Method Summary collapse
-
#initialize(raw_button_name) ⇒ Formatter
constructor
A new instance of Formatter.
- #to_method ⇒ Object
- #to_title ⇒ Object
Constructor Details
#initialize(raw_button_name) ⇒ Formatter
Returns a new instance of Formatter.
3 4 5 |
# File 'lib/hstore_radio_buttons/formatter.rb', line 3 def initialize() self. = end |
Instance Method Details
#to_method ⇒ Object
7 8 9 |
# File 'lib/hstore_radio_buttons/formatter.rb', line 7 def to_method .to_s.gsub(/ /,"_").downcase end |
#to_title ⇒ Object
11 12 13 |
# File 'lib/hstore_radio_buttons/formatter.rb', line 11 def to_title .to_s.gsub(/_/," ").titleize end |