Class: Vop::EntityDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/vop/objects/entity_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plugin, name) ⇒ EntityDefinition

Returns a new instance of EntityDefinition.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vop/objects/entity_definition.rb', line 11

def initialize(plugin, name)
  @plugin = plugin
  @name = name
  @key = "name"
  @data = {}

  @block = lambda { |params| $logger.warn "entity #{name} does not have a run block" }

  @on = nil
  @show_options = {}
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



7
8
9
# File 'lib/vop/objects/entity_definition.rb', line 7

def block
  @block
end

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/vop/objects/entity_definition.rb', line 6

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/vop/objects/entity_definition.rb', line 5

def name
  @name
end

#onObject

Returns the value of attribute on.



8
9
10
# File 'lib/vop/objects/entity_definition.rb', line 8

def on
  @on
end

#pluginObject (readonly)

Returns the value of attribute plugin.



5
6
7
# File 'lib/vop/objects/entity_definition.rb', line 5

def plugin
  @plugin
end

#show_optionsObject

Returns the value of attribute show_options.



9
10
11
# File 'lib/vop/objects/entity_definition.rb', line 9

def show_options
  @show_options
end

Instance Method Details

#short_nameObject



23
24
25
# File 'lib/vop/objects/entity_definition.rb', line 23

def short_name
  @name.split(".").last
end

#sourceObject



27
28
29
# File 'lib/vop/objects/entity_definition.rb', line 27

def source
  plugin.sources[:entities][name]
end