Sha256: 7d33f2892b95702cde42e07788fcda724ad092ade5d061a162048c66f447f1ad

Contents?: true

Size: 846 Bytes

Versions: 3

Compression:

Stored size: 846 Bytes

Contents

module Serialbox
 module BoilerPlate

  def self.listener_class
    "require 'serialbox'\n"+
    "require_relative 'data_file'\n\n"+
  	"class Listener\n"+
  	"\tinclude Serialbox::Listener\n"+
  	"\tdef parse(string)\n"+
  	"\t#TODO: implement your parser here\n"+
  	"\tend\n"+
  	"end\n"+
  	"\n\n"+
    "ln = Listener.new\n"+
	"ln.setup(serialport params)\n"+
	"ln.run\n"
  end

  def self.data_file_class
  	"class DataFile\n"+
  	"\tinclude Serialbox::Adapter\n"+
  	"\tstore_in session: 'default'\n"+
  	"\t#TODO: add your data variables here\n"+
  	"\t#field :time\n"+
  	"\t#field :experiment\n"+
  	"end\n\n"+
  	"#Subclass DataFile for specific data points"
  	"class DataPoint < DataFile\n"+
  	"\t#field :temp\n"+
  	"end"
  end

  def self.config_adapter_string(adapter)
  	"\tconfigure_adapter :#{adapter.to_sym}\n"
  end
 end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
serialbar-0.0.3 lib/serialbar/generators/boiler_plate.rb
serialbar-0.0.2 lib/serialbar/generators/boiler_plate.rb
serialbar-0.0.1 lib/serialbar/generators/boiler_plate.rb