rack-app-front_end 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d90fa0a6d8b2ac46cbb6c8b412794ec196bd6b3
4
- data.tar.gz: fee7347ba0ee77b07f12faf74e5865a2bca743fa
3
+ metadata.gz: 79aa6e0540c91496fb40688c70656e16f36c40eb
4
+ data.tar.gz: 7dce84eb5f012007d72db48dcc7d236ad1610969
5
5
  SHA512:
6
- metadata.gz: 17d63a3268e88615a6f7df1e68dae6910cbcab079229eb9efefeab6045a51a642362ef8a385f86ee7991571080614e8809a44651fb47b686a962051c1592c130
7
- data.tar.gz: 41333b68d01a4adbbb3627fbdef332fb4053a27306add4ce9f40464e7ceec1b31856b83f580d4c3276332c6ae6c292ad0b97246dfb569c1d3555c79acc5469d4
6
+ metadata.gz: 184325dd6400fd8d4e770dea2fedd1bb21a713c8a1d2a1ea54649b619216039514d13033e5e5414e071cfa440774383b7e34f1765944aa3d623d78a97f2d1942
7
+ data.tar.gz: 1955e1036f1d114a21871122d5887f3ec3f748e36ca85b0eb76d39dc214ced0d387be3acfdd6023c505f5e335c3a4cebfd7e5730a5b2cedb9e830ea3ceaf76c5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.21.0
1
+ 0.22.0
@@ -2,7 +2,7 @@ module Rack::App::FrontEnd::Helpers::Table
2
2
  module Builder
3
3
  extend(self)
4
4
 
5
- def from_array_of_hash(array_of_hash)
5
+ def from_array_of_hash(array_of_hash, attributes)
6
6
  headers = array_of_hash.each_with_object([]) do |hash, trs|
7
7
  trs.push(*hash.keys)
8
8
  trs.uniq!
@@ -11,7 +11,7 @@ module Rack::App::FrontEnd::Helpers::Table
11
11
  o = Object.new
12
12
  o.extend(Rack::App::FrontEnd::Helpers::HtmlDsl)
13
13
 
14
- table_html = o.__send__ :table_tag do
14
+ table_html = o.__send__ :table_tag, attributes do
15
15
  tr_tag do
16
16
  headers.each do |header|
17
17
  td_tag String(header)
@@ -30,11 +30,11 @@ module Rack::App::FrontEnd::Helpers::Table
30
30
  table_html
31
31
  end
32
32
 
33
- def from_hash(hash)
33
+ def from_hash(hash, attributes)
34
34
  o = Object.new
35
35
  o.extend(Rack::App::FrontEnd::Helpers::HtmlDsl)
36
36
 
37
- table_html = o.__send__ :table_tag do
37
+ table_html = o.__send__ :table_tag, attributes do
38
38
  hash.each do |key, value|
39
39
  tr_tag do
40
40
  td_tag String(key)
@@ -47,11 +47,11 @@ module Rack::App::FrontEnd::Helpers::Table
47
47
  end
48
48
  end
49
49
 
50
- def table_by(object)
50
+ def table_by(object, attributes={})
51
51
  if object.is_a?(Array) && object.all? { |e| e.is_a?(Hash) }
52
- Builder.from_array_of_hash(object)
52
+ Builder.from_array_of_hash(object, attributes)
53
53
  elsif object.is_a?(Hash)
54
- Builder.from_hash(object)
54
+ Builder.from_hash(object, attributes)
55
55
  else
56
56
  raise("don't know how to build table from this: #{object}")
57
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-app-front_end
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi