Class: Tensai::Logic::Entity
- Inherits:
-
Object
- Object
- Tensai::Logic::Entity
- Defined in:
- lib/tensai/logic/entity.rb
Overview
Logical entity which appears in predicates
Class Method Summary collapse
-
.create_subtype(name) ⇒ Object
Create a subtype with the specified name.
-
.name ⇒ Object
Name of entity class.
Instance Method Summary collapse
Class Method Details
.create_subtype(name) ⇒ Object
Create a subtype with the specified name
32 33 34 35 36 |
# File 'lib/tensai/logic/entity.rb', line 32 def create_subtype(name) Class.new(self) do @name = Dry::Inflector.new.classify(name.to_s) end end |
.name ⇒ Object
Name of entity class
25 26 27 |
# File 'lib/tensai/logic/entity.rb', line 25 def name @name || 'Entity' end |
Instance Method Details
#inspect ⇒ Object
17 18 19 |
# File 'lib/tensai/logic/entity.rb', line 17 def inspect "#{self.class.name}(#{name})" end |