class Orphic::OrphicCli::Cursor
Public Instance Methods
GeekCursor( currentGeek )
click to toggle source
# File lib/orphic/cli/sprites/cursor.rb, line 29 def GeekCursor ( currentGeek ) CLI::UI::Frame.open( "Cursor :: Geek : " + currentGeek ) do puts "#{currentGeek}" end end
mongoDb( mongoURL )
click to toggle source
# File lib/orphic/cli/sprites/cursor.rb, line 44 def mongoDb ( mongoURL ) # mongoDB client setup client = Mongo::Client.new( mongoURL ) collection = client[:people] # example doc for testing doc = { name: 'Steve', hobbies: [ 'hiking', 'tennis', 'fly fishing' ], siblings: { brothers: 0, sisters: 1 } } if options[:create] result = collection.insert_one(doc) CLI::UI::Frame.open("Cursor :: MongoDB :: " + mongoURL + ": Create ") puts result.n end if options[:read] collection.find.each do |document| #=> Yields a BSON::Document. CLI::UI::Frame.open( "Cursor :: MongoDB :: " + mongoURL + ": Read ") puts document end end if options[:update] puts "update put" end if options[:delete] puts "Delete option" end # implement mongoURL for viewing current info CLI::UI::Frame.open( "Cursor :: Mongo :: DB : " + mongoURL ) do puts "#{mongoURL}" end end
posCursor( currentCursor )
click to toggle source
# File lib/orphic/cli/sprites/cursor.rb, line 15 def posCursor( currentCursor ) # implement viewType CLI::UI::Frame.open( "Cursor :: Position : " + currentCursor ) do puts "#{currentCursor}" end end