Class: Project::ProjectFile
- Inherits:
-
Object
- Object
- Project::ProjectFile
- Defined in:
- app/project/file.rb
Overview
extracts capabilities and definitions from project files
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
readonly
Returns the value of attribute capabilities.
-
#definitions ⇒ Object
readonly
Returns the value of attribute definitions.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(project_file_path) ⇒ ProjectFile
constructor
A new instance of ProjectFile.
Constructor Details
#initialize(project_file_path) ⇒ ProjectFile
Returns a new instance of ProjectFile.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/project/file.rb', line 4 def initialize project_file_path @path = project_file_path @definitions = [] @capabilities = [] file = File.read project_file_path method_names_cache = methods(false) instance_eval file sandbox = Project::Sandbox.dup sandbox.module_eval(file) sandbox.instance_methods.each do |name| @capabilities.append Project::Capability.new( name: name, content: sandbox.instance_method(name) ) end end |
Instance Attribute Details
#capabilities ⇒ Object (readonly)
Returns the value of attribute capabilities.
21 22 23 |
# File 'app/project/file.rb', line 21 def capabilities @capabilities end |
#definitions ⇒ Object (readonly)
Returns the value of attribute definitions.
21 22 23 |
# File 'app/project/file.rb', line 21 def definitions @definitions end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
21 22 23 |
# File 'app/project/file.rb', line 21 def path @path end |