lib/state_manager/dsl.rb in state_manager-0.2.4 vs lib/state_manager/dsl.rb in state_manager-0.2.5
- old
+ new
@@ -1,17 +1,17 @@
-require 'active_support/core_ext'
+require 'active_support/all'
module StateManager
module DSL
module State
# Specifies a state that is a child of the current state
def state(name, klass=nil, &block)
# If no base class is specified we look for a class inside the current
# state's class which has the same name as the state
- const_name = name.capitalize
+ const_name = name.to_s.classify
klass ||= if const_defined?(const_name)
- self.const_get(name.capitalize)
+ self.const_get(const_name)
else
Class.new(StateManager::State)
end
klass = Class.new(klass, &block) if block_given?
\ No newline at end of file