Class: Markdownplus::Julia::DataFrameHandler::DataFrame

Inherits:
Object
  • Object
show all
Defined in:
lib/markdownplus/julia.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, csv) ⇒ DataFrame

Returns a new instance of DataFrame.



35
36
37
38
# File 'lib/markdownplus/julia.rb', line 35

def initialize(name, csv)
  @name = name
  @csv = csv
end

Instance Attribute Details

#csvObject (readonly)

Returns the value of attribute csv.



33
34
35
# File 'lib/markdownplus/julia.rb', line 33

def csv
  @csv
end

#nameObject (readonly)

Returns the value of attribute name.



32
33
34
# File 'lib/markdownplus/julia.rb', line 32

def name
  @name
end

Instance Method Details

#to_juliaObject



40
41
42
43
44
45
# File 'lib/markdownplus/julia.rb', line 40

def to_julia
  file = Tempfile.new(['data','.csv'])
  file.write(csv)
  file.close
  output = "#{name} = readcsv(\"#{file.path}\")\n"
end