Module: Kernel

Defined in:
lib/sketches/extensions/kernel.rb

Instance Method Summary collapse

Instance Method Details

#name_sketch(id, name) ⇒ Object

Names the sketch with the specified id with the specified name.

name_sketch 2, :foo


52
53
54
# File 'lib/sketches/extensions/kernel.rb', line 52

def name_sketch(id,name)
  Sketches.name(id,name)
end

#save_sketch(id_or_name, path) ⇒ Object

Saves the sketch with the specified id_or_name to the specified path.

save_sketch 2, 'path/to/example.rb'

save_sketch :foo, 'path/to/foo.rb'


64
65
66
# File 'lib/sketches/extensions/kernel.rb', line 64

def save_sketch(id_or_name,path)
  Sketches.save(id_or_name,path)
end

#sketch(id_or_name = nil) ⇒ Object

Edits the sketch with the specified id_or_name. If no sketch exists with the specified id_or_name, one will be created.

sketch 2

sketch :foo


34
35
36
# File 'lib/sketches/extensions/kernel.rb', line 34

def sketch(id_or_name=nil)
  Sketches.sketch(id_or_name)
end

#sketch_from(path) ⇒ Object

Creates a new sketch using the specified path.

sketch_from 'path/to/foo.rb'


43
44
45
# File 'lib/sketches/extensions/kernel.rb', line 43

def sketch_from(path)
  Sketches.from(path)
end

#sketchesObject

Print out all of the sketches.



71
72
73
# File 'lib/sketches/extensions/kernel.rb', line 71

def sketches
  Sketches.print
end