bootstrap_builders 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bootstrap_builders/panel.rb +18 -14
- data/lib/bootstrap_builders/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84e412b7027b0e2a0cd541939949d2f9f54c62c
|
4
|
+
data.tar.gz: df308c701ab84db160feac10c21a1734f762aa02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c504ef03e04e20163e1d81f55e53aa67db34737f37d8abf28782cb5f5ea87169abc5472237ce1038805bf0197633dfc0f3d79c016ca2f1bd37676862c3ec26f1
|
7
|
+
data.tar.gz: 3ae3758c104be3de4cf68c0e92826c29c9464074f3d32677af19a4ee028bc24681d1f1ffb3de462411f8bdbc72cd8bf03ff52032a3b25aba63c10a164144b38d
|
@@ -1,20 +1,24 @@
|
|
1
1
|
class BootstrapBuilders::Panel
|
2
2
|
attr_accessor :context, :controls
|
3
3
|
|
4
|
-
def self.with_parsed_args(*
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
4
|
+
def self.with_parsed_args(*args_given, &blk)
|
5
|
+
args_parser = BootstrapBuilders::ArgumentsParser.new(
|
6
|
+
arguments: args_given,
|
7
|
+
short_true_arguments: [
|
8
|
+
:table
|
9
|
+
]
|
10
|
+
)
|
11
|
+
args = args_parser.arguments
|
12
|
+
args_hash = args_parser.arguments_hash
|
13
|
+
|
14
|
+
title = args.shift if args.first.is_a?(String)
|
15
|
+
width = args.shift unless args.first.is_a?(Hash)
|
16
|
+
|
17
|
+
title = args_hash.fetch(:title) if args_hash.key?(:title)
|
18
|
+
width = args_hash[:width] if args_hash.key?(:width)
|
19
|
+
right = args_hash[:right] if args_hash.key?(:right)
|
20
|
+
|
21
|
+
BootstrapBuilders::Panel.new(args_hash.merge(title: title, width: width, right: right, block: blk))
|
18
22
|
end
|
19
23
|
|
20
24
|
def initialize(args)
|