Class: Vedeu::TestApplication
- Inherits:
-
Object
- Object
- Vedeu::TestApplication
- Defined in:
- lib/vedeu/distributed/test_application.rb
Overview
Create a test application as a string.
Instance Attribute Summary collapse
- #borders ⇒ String
- #configuration ⇒ String
- #events ⇒ String
- #geometries ⇒ String
- #interfaces ⇒ String
- #keymaps ⇒ String
- #menus ⇒ String
- #views ⇒ String
Class Method Summary collapse
Instance Method Summary collapse
- #build(&block) ⇒ String
-
#defaults ⇒ Hash<Symbol => void>
private
The default options/attributes for a new instance of this class.
-
#initialize(attributes = {}) ⇒ Vedeu::TestApplication
constructor
Returns a new instance of Vedeu::TestApplication.
- #lib_dir ⇒ String
- #read(filename) ⇒ String private
- #template ⇒ String private
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::TestApplication
Returns a new instance of Vedeu::TestApplication.
70 71 72 73 74 |
# File 'lib/vedeu/distributed/test_application.rb', line 70 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#borders ⇒ String
23 24 25 |
# File 'lib/vedeu/distributed/test_application.rb', line 23 def borders @borders end |
#configuration ⇒ String
27 28 29 |
# File 'lib/vedeu/distributed/test_application.rb', line 27 def configuration @configuration end |
#events ⇒ String
31 32 33 |
# File 'lib/vedeu/distributed/test_application.rb', line 31 def events @events end |
#geometries ⇒ String
35 36 37 |
# File 'lib/vedeu/distributed/test_application.rb', line 35 def geometries @geometries end |
#interfaces ⇒ String
39 40 41 |
# File 'lib/vedeu/distributed/test_application.rb', line 39 def interfaces @interfaces end |
#keymaps ⇒ String
43 44 45 |
# File 'lib/vedeu/distributed/test_application.rb', line 43 def keymaps @keymaps end |
#menus ⇒ String
47 48 49 |
# File 'lib/vedeu/distributed/test_application.rb', line 47 def @menus end |
#views ⇒ String
51 52 53 |
# File 'lib/vedeu/distributed/test_application.rb', line 51 def views @views end |
Class Method Details
.build(attributes = {}, &block) ⇒ Object
54 55 56 |
# File 'lib/vedeu/distributed/test_application.rb', line 54 def self.build(attributes = {}, &block) new(attributes).build(&block) end |
Instance Method Details
#build(&block) ⇒ String
78 79 80 81 82 |
# File 'lib/vedeu/distributed/test_application.rb', line 78 def build(&block) instance_eval(&block) if block_given? Vedeu::Templating::Template.parse(self, template) end |
#defaults ⇒ Hash<Symbol => void> (private)
The default options/attributes for a new instance of this class.
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/vedeu/distributed/test_application.rb', line 97 def defaults { borders: read('default_borders.vedeu'), configuration: read('default_configuration.vedeu'), events: read('default_events.vedeu'), geometries: read('default_geometries.vedeu'), interfaces: read('default_interfaces.vedeu'), keymaps: read('default_keymaps.vedeu'), menus: read('default_menus.vedeu'), views: read('default_views.vedeu'), } end |
#lib_dir ⇒ String
85 86 87 |
# File 'lib/vedeu/distributed/test_application.rb', line 85 def lib_dir File.dirname(__FILE__) + '/../../../lib' end |
#read(filename) ⇒ String (private)
111 112 113 |
# File 'lib/vedeu/distributed/test_application.rb', line 111 def read(filename) File.read(File.dirname(__FILE__) + '/templates/' + filename) end |
#template ⇒ String (private)
92 93 94 |
# File 'lib/vedeu/distributed/test_application.rb', line 92 def template File.dirname(__FILE__) + '/templates/default_application.vedeu' end |