Module: Bumbleworks::Entity::ClassMethods
- Defined in:
- lib/bumbleworks/entity.rb
Instance Method Summary collapse
- #default_process_identifier_attribute(process_name) ⇒ Object
- #entity_type ⇒ Object
- #process(process_name, options = {}) ⇒ Object
- #processes ⇒ Object
Instance Method Details
#default_process_identifier_attribute(process_name) ⇒ Object
114 115 116 117 118 119 |
# File 'lib/bumbleworks/entity.rb', line 114 def default_process_identifier_attribute(process_name) identifier_attribute = "#{process_name}_process_identifier" identifier_attribute.gsub!(/^#{entity_type}_/, '') identifier_attribute.gsub!(/process_process/, 'process') identifier_attribute.to_sym end |
#entity_type ⇒ Object
110 111 112 |
# File 'lib/bumbleworks/entity.rb', line 110 def entity_type Bumbleworks::Support.tokenize(name) end |
#process(process_name, options = {}) ⇒ Object
101 102 103 104 |
# File 'lib/bumbleworks/entity.rb', line 101 def process(process_name, = {}) [:attribute] ||= default_process_identifier_attribute(process_name) processes[process_name.to_sym] = end |
#processes ⇒ Object
106 107 108 |
# File 'lib/bumbleworks/entity.rb', line 106 def processes @processes ||= {} end |