Class: Canoe::CompilationDatabase
- Inherits:
-
Object
- Object
- Canoe::CompilationDatabase
- Defined in:
- lib/workspace/build.rb
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
Instance Method Summary collapse
- #add_command_object(dir, arguments, file) ⇒ Object
-
#initialize ⇒ CompilationDatabase
constructor
A new instance of CompilationDatabase.
- #pretty_to_s ⇒ Object
- #to_json ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ CompilationDatabase
Returns a new instance of CompilationDatabase.
167 168 169 |
# File 'lib/workspace/build.rb', line 167 def initialize @database = [] end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
166 167 168 |
# File 'lib/workspace/build.rb', line 166 def database @database end |
Instance Method Details
#add_command_object(dir, arguments, file) ⇒ Object
171 172 173 174 175 176 177 178 |
# File 'lib/workspace/build.rb', line 171 def add_command_object(dir, arguments, file) temp = { "arguments" => arguments, "directory" => dir, "file" => file } @database << temp end |
#pretty_to_s ⇒ Object
184 185 186 |
# File 'lib/workspace/build.rb', line 184 def pretty_to_s JSON.pretty_generate(@database) end |
#to_json ⇒ Object
188 189 190 |
# File 'lib/workspace/build.rb', line 188 def to_json @database.to_json end |
#to_s ⇒ Object
180 181 182 |
# File 'lib/workspace/build.rb', line 180 def to_s @database.to_s end |