class Sapling
The main Sapling
interface.
Public Instance Methods
edit(file = '')
click to toggle source
# File lib/sapling.rb, line 20 def edit(file = '') puts 'Welcome to Sapling, a Dialogue Tree Utility.' if !tree.empty? puts "Loading tree: #{file}" exit unless verify_tree(file) gardner = Planter::Spade.new(YAML.load_file(tree, false)) else puts 'Creating a new tree!' gardner = Planter::Spade.new(SKELETON_TREE) end gardner.plant end
export(tree)
click to toggle source
# File lib/sapling.rb, line 40 def export(tree) exit unless verify_tree(tree) puts 'Cool feature, bro!' end
read(file)
click to toggle source
# File lib/sapling.rb, line 11 def read(file) puts 'Welcome to Sapling, a Dialogue Tree Utility.' exit unless verify_tree(file) tree = Gardner::Plot.new(YAML.load_file(file)) speaker = Dialogue::Speaker.new(tree, false) speaker.conversation end
serve(tree)
click to toggle source
# File lib/sapling.rb, line 34 def serve(tree) exit unless verify_tree(tree) puts 'Sinatra will be cool.' end