Class: ExpressMailer::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/express_mailer/table.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = []) ⇒ Table

Returns a new instance of Table.



13
14
15
16
# File 'lib/express_mailer/table.rb', line 13

def initialize(data = [])
  @data = data
  @column_count = rows[0].size
end

Instance Attribute Details

#column_count ⇒ Object

Returns the value of attribute column_count.



3
4
5
# File 'lib/express_mailer/table.rb', line 3

def column_count
  @column_count
end

#data ⇒ Object

Returns the value of attribute data.



3
4
5
# File 'lib/express_mailer/table.rb', line 3

def data
  @data
end

Class Method Details

.create(data) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/express_mailer/table.rb', line 5

def self.create(data)
  if data
    new(data)
  else
    nil
  end
end

Instance Method Details

#rows ⇒ Object



18
19
20
# File 'lib/express_mailer/table.rb', line 18

def rows
  @data
end