Class: Blooper::Rows

Inherits:
Object
  • Object
show all
Defined in:
lib/blooper/rows.rb

Instance Method Summary collapse

Constructor Details

#initialize(line = STDIN) ⇒ Rows

Returns a new instance of Rows.



4
5
6
# File 'lib/blooper/rows.rb', line 4

def initialize(line = STDIN)
  @line = line
end

Instance Method Details

#rowsObject



8
9
10
# File 'lib/blooper/rows.rb', line 8

def rows
  Hash[*@line.split]
end

#saveObject



12
13
14
# File 'lib/blooper/rows.rb', line 12

def save
  DB.instance.insert(rows)
end