Module: Vop::EntitySyntax
- Defined in:
- lib/vop/syntax/entity_syntax.rb
Instance Method Summary collapse
- #entity(options = { key: "name" }, &block) ⇒ Object
- #key(key) ⇒ Object
- #on(other_entity) ⇒ Object
- #run(&block) ⇒ Object
- #show(options = {}) ⇒ Object
Instance Method Details
#entity(options = { key: "name" }, &block) ⇒ Object
9 10 11 12 13 |
# File 'lib/vop/syntax/entity_syntax.rb', line 9 def entity( = { key: "name" }, &block) if block run(&block) end end |
#key(key) ⇒ Object
5 6 7 |
# File 'lib/vop/syntax/entity_syntax.rb', line 5 def key(key) @entity.key = key end |
#on(other_entity) ⇒ Object
19 20 21 |
# File 'lib/vop/syntax/entity_syntax.rb', line 19 def on(other_entity) @entity.on = other_entity end |
#run(&block) ⇒ Object
15 16 17 |
# File 'lib/vop/syntax/entity_syntax.rb', line 15 def run(&block) @entity.block = block end |
#show(options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/vop/syntax/entity_syntax.rb', line 23 def show( = {}) = .delete(:columns) display_type = .delete(:display_type) raise "unknown keyword #{.keys.first}" if .keys.length > 0 @entity.[:columns] = @entity.[:display_type] = display_type end |