Fix the csv_import.rb sample to function properly
This commit is contained in:
@@ -5,15 +5,13 @@ Squib::Deck.new(cards: 2) do
|
||||
|
||||
# Outputs a hash of arrays with the header names as keys
|
||||
data = csv file: 'sample.csv'
|
||||
|
||||
text str: data['Name'], x: 250, y: 55, font: 'Arial 54'
|
||||
text str: data['Type'], x: 250, y: 55, font: 'Arial 54'
|
||||
text str: data['Level'], x: 65, y: 65, font: 'Arial 72'
|
||||
text str: data['Description'], x: 65, y: 600, font: 'Arial 36'
|
||||
|
||||
save format: :png, prefix: 'sample_csv_'
|
||||
|
||||
# You can also specify the sheet, starting at 0
|
||||
data = xlsx file: 'sample.xlsx', sheet: 2
|
||||
|
||||
save format: :png, prefix: 'sample_csv_'
|
||||
end
|
||||
|
||||
# CSV is also a Squib-module-level function, so this also works:
|
||||
|
||||
+3
-3
@@ -1,3 +1,3 @@
|
||||
Type,"Quantity"
|
||||
Thief,2
|
||||
Mastermind,1
|
||||
Type,"Level"
|
||||
Thief,1
|
||||
Mastermind,2
|
||||
|
Reference in New Issue
Block a user