Class: HstoreRadioButtons::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/hstore_radio_buttons/formatter.rb

Instance Method Summary collapse

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(raw_button_name)
  self.raw_button_name = raw_button_name
end

Instance Method Details

#to_methodObject



7
8
9
# File 'lib/hstore_radio_buttons/formatter.rb', line 7

def to_method
  raw_button_name.to_s.gsub(/ /,"_").downcase
end

#to_titleObject



11
12
13
# File 'lib/hstore_radio_buttons/formatter.rb', line 11

def to_title
  raw_button_name.to_s.gsub(/_/," ").titleize
end