Class: HstoreRadioButtons::MethodNamer

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

Instance Method Summary collapse

Constructor Details

#initialize(button_name) ⇒ MethodNamer

Returns a new instance of MethodNamer.



3
4
5
# File 'lib/hstore_radio_buttons/method_namer.rb', line 3

def initialize(button_name)
  self.button_name = HstoreRadioButtons::Formatter.new(button_name).to_method
end

Instance Method Details

#getterObject



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

def getter
  button_name.to_sym
end

#optionsObject



15
16
17
# File 'lib/hstore_radio_buttons/method_namer.rb', line 15

def options
  "#{button_name}_options".to_sym
end

#setterObject



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

def setter
  "#{button_name}=".to_sym
end