Module: Gexp

Defined in:
lib/gexp/mongoid/transaction.rb,
lib/gexp.rb,
lib/gexp/item.rb,
lib/gexp/user.rb,
lib/gexp/object.rb,
lib/gexp/command.rb,
lib/gexp/handler.rb,
lib/gexp/mongoid.rb,
lib/gexp/version.rb,
lib/gexp/receiver.rb,
lib/gexp/command/stack.rb,
lib/gexp/handler/check.rb,
lib/gexp/command/object.rb,
lib/gexp/handler/caller.rb,
lib/gexp/handler/modify.rb,
lib/gexp/handler/producer.rb,
lib/gexp/receiver/example.rb,
lib/gexp/receiver/mongoid.rb,
lib/gexp/state_definition.rb,
lib/gexp/handler/check/item.rb,
lib/gexp/handler/transition.rb,
lib/gexp/handler/check/resources.rb,
lib/gexp/handler/modify/resources.rb,
lib/gexp/handler/transition/builder.rb,
lib/gexp/state_definition/state_machine.rb

Overview

Изменяет количество ресурсов у пользователя

Defined Under Namespace

Modules: Item, Mongoid, Object, StateDefinition, User Classes: Command, Handler, Receiver

Constant Summary collapse

VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.class_to_label(klass) ⇒ Object



11
12
13
14
# File 'lib/gexp.rb', line 11

def class_to_label(klass)
  klass.name.split('::').
    map(&:underscore).join('.')
end

.label_to_class(label) ⇒ Object



5
6
7
8
9
# File 'lib/gexp.rb', line 5

def label_to_class(label)
  label.split('.').
    map(&:classify).
    join('::').constantize
end