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 private
-
#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.
68 69 70 71 72 |
# File 'lib/vedeu/distributed/test_application.rb', line 68 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#borders ⇒ String
21 22 23 |
# File 'lib/vedeu/distributed/test_application.rb', line 21 def borders @borders end |
#configuration ⇒ String
25 26 27 |
# File 'lib/vedeu/distributed/test_application.rb', line 25 def configuration @configuration end |
#events ⇒ String
29 30 31 |
# File 'lib/vedeu/distributed/test_application.rb', line 29 def events @events end |
#geometries ⇒ String
33 34 35 |
# File 'lib/vedeu/distributed/test_application.rb', line 33 def geometries @geometries end |
#interfaces ⇒ String
37 38 39 |
# File 'lib/vedeu/distributed/test_application.rb', line 37 def interfaces @interfaces end |
#keymaps ⇒ String
41 42 43 |
# File 'lib/vedeu/distributed/test_application.rb', line 41 def keymaps @keymaps end |
#menus ⇒ String
45 46 47 |
# File 'lib/vedeu/distributed/test_application.rb', line 45 def @menus end |
#views ⇒ String
49 50 51 |
# File 'lib/vedeu/distributed/test_application.rb', line 49 def views @views end |
Class Method Details
.build(attributes = {}, &block) ⇒ Object
52 53 54 |
# File 'lib/vedeu/distributed/test_application.rb', line 52 def self.build(attributes = {}, &block) new(attributes).build(&block) end |
Instance Method Details
#build(&block) ⇒ String
76 77 78 79 80 |
# File 'lib/vedeu/distributed/test_application.rb', line 76 def build(&block) instance_eval(&block) if block_given? Vedeu::Templating::Template.parse(self, template) end |
#defaults ⇒ Hash (private)
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
83 84 85 |
# File 'lib/vedeu/distributed/test_application.rb', line 83 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)
90 91 92 |
# File 'lib/vedeu/distributed/test_application.rb', line 90 def template File.dirname(__FILE__) + '/templates/default_application.vedeu' end |