Class: Vop::EntityDefinition
- Inherits:
-
Object
- Object
- Vop::EntityDefinition
- Defined in:
- lib/vop/objects/entity_definition.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#description ⇒ Object
Returns the value of attribute description.
-
#invalidation_block ⇒ Object
Returns the value of attribute invalidation_block.
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#on ⇒ Object
Returns the value of attribute on.
-
#plugin ⇒ Object
readonly
Returns the value of attribute plugin.
-
#read_only ⇒ Object
Returns the value of attribute read_only.
-
#show_options ⇒ Object
Returns the value of attribute show_options.
Instance Method Summary collapse
-
#initialize(plugin, name) ⇒ EntityDefinition
constructor
A new instance of EntityDefinition.
- #list_command_name ⇒ Object
- #short_name ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(plugin, name) ⇒ EntityDefinition
Returns a new instance of EntityDefinition.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vop/objects/entity_definition.rb', line 16 def initialize(plugin, name) @plugin = plugin @name = name @key = "name" @data = {} @block = lambda { |params| $logger.warn "entity #{name} does not have a run block" } @invalidation_block = nil @on = nil = {} @read_only = true end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
9 10 11 |
# File 'lib/vop/objects/entity_definition.rb', line 9 def block @block end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/vop/objects/entity_definition.rb', line 6 def description @description end |
#invalidation_block ⇒ Object
Returns the value of attribute invalidation_block.
13 14 15 |
# File 'lib/vop/objects/entity_definition.rb', line 13 def invalidation_block @invalidation_block end |
#key ⇒ Object
Returns the value of attribute key.
8 9 10 |
# File 'lib/vop/objects/entity_definition.rb', line 8 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/vop/objects/entity_definition.rb', line 5 def name @name end |
#on ⇒ Object
Returns the value of attribute on.
10 11 12 |
# File 'lib/vop/objects/entity_definition.rb', line 10 def on @on end |
#plugin ⇒ Object (readonly)
Returns the value of attribute plugin.
5 6 7 |
# File 'lib/vop/objects/entity_definition.rb', line 5 def plugin @plugin end |
#read_only ⇒ Object
Returns the value of attribute read_only.
14 15 16 |
# File 'lib/vop/objects/entity_definition.rb', line 14 def read_only @read_only end |
#show_options ⇒ Object
Returns the value of attribute show_options.
11 12 13 |
# File 'lib/vop/objects/entity_definition.rb', line 11 def end |
Instance Method Details
#list_command_name ⇒ Object
38 39 40 |
# File 'lib/vop/objects/entity_definition.rb', line 38 def list_command_name short_name.carefully_pluralize end |
#short_name ⇒ Object
30 31 32 |
# File 'lib/vop/objects/entity_definition.rb', line 30 def short_name @name.split(".").last end |
#source ⇒ Object
34 35 36 |
# File 'lib/vop/objects/entity_definition.rb', line 34 def source plugin.sources[:entities][name] end |