csl 1.0.0.pre18 → 1.0.0.pre19

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
@@ -25,6 +25,14 @@ module CSL
25
25
  attributes.fetch(:delimiter, '')
26
26
  end
27
27
 
28
+ def has_form?
29
+ attribute?(:form)
30
+ end
31
+
32
+ def form
33
+ attributes[:form].to_s
34
+ end
35
+
28
36
  def text?
29
37
  !numeric?
30
38
  end
@@ -45,7 +45,7 @@ module CSL
45
45
  alias localized? has_form?
46
46
 
47
47
  def form
48
- attributes[:form]
48
+ attributes[:form].to_s
49
49
  end
50
50
 
51
51
  def numeric?
@@ -1,8 +1,29 @@
1
1
  module CSL
2
2
  class Style
3
3
 
4
+ # The Group rendering element must contain one or more rendering
5
+ # element (with the exception of {Layout}). Group nodes may carry the
6
+ # delimiter attribute to separate their child elements, as well as
7
+ # affixes and display attributes (applied to the output of the group
8
+ # as a whole) and formatting attributes (transmitted to the enclosed
9
+ # elements).
10
+ #
11
+ # Groups implicitly act as a conditionals: a Group and its child
12
+ # elements are suppressed if a) at least one rendering element in
13
+ # the Group calls a variable (either directly or via a macro), and
14
+ # b) all variables that are called are empty.
4
15
  class Group < Node
5
- attr_struct *Schema.attr(:affixes, :display, :delimiter)
16
+ attr_struct(*Schema.attr(:formatting, :affixes, :display, :delimiter))
17
+
18
+ def delimiter
19
+ attributes.fetch(:delimiter, '')
20
+ end
21
+
22
+ private
23
+
24
+ def added_child(node)
25
+ node.attribtes.merge formatting_options
26
+ end
6
27
  end
7
28
 
8
29
  end
@@ -1,3 +1,3 @@
1
1
  module CSL
2
- VERSION = '1.0.0.pre18'.freeze
2
+ VERSION = '1.0.0.pre19'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre18
4
+ version: 1.0.0.pre19
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: -4542727712575061360
186
+ hash: -1221236240985250684
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements: