Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/hobo_ckeditor/string.rb

Instance Method Summary collapse

Instance Method Details

#to_object_name_and_method_nameObject



2
3
4
5
6
7
# File 'lib/hobo_ckeditor/string.rb', line 2

def to_object_name_and_method_name
  object_name, method_name = self.split('[')[-1].split().unshift(self.split('[')[0..-2].join('['))
  method_name.chomp!(']') if method_name && !method_name.empty?
  method_name, object_name = [object_name, 'this'] if !method_name
  [object_name.to_sym, method_name.to_s]
end