Class: Mortar::Project::Script
- Inherits:
-
Object
- Object
- Mortar::Project::Script
- Defined in:
- lib/mortar/project.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(name, path) ⇒ Script
constructor
A new instance of Script.
- #to_s ⇒ Object
Constructor Details
#initialize(name, path) ⇒ Script
Returns a new instance of Script.
186 187 188 189 |
# File 'lib/mortar/project.rb', line 186 def initialize(name, path) @name = name @path = path end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
183 184 185 |
# File 'lib/mortar/project.rb', line 183 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
184 185 186 |
# File 'lib/mortar/project.rb', line 184 def path @path end |
Instance Method Details
#code ⇒ Object
191 192 193 194 195 196 |
# File 'lib/mortar/project.rb', line 191 def code script_file = File.open(@path, "r") script_contents = script_file.read script_file.close script_contents end |
#to_s ⇒ Object
198 199 200 |
# File 'lib/mortar/project.rb', line 198 def to_s code end |