simple_calendar 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cde59f7b5261410c7433f612f66497b2ca0d94b5
4
- data.tar.gz: da698473ac70482bcee27cfcd9a8d9e52723bb1f
3
+ metadata.gz: 08c146f5a7b38c2327df0f20dc4026598a0f9d8a
4
+ data.tar.gz: ac0162169f6c8fb91de3ec38db5fea38e9a82678
5
5
  SHA512:
6
- metadata.gz: efad6cae850b219bbf67bed72472f907ae8167d85ce886c03d61b17fbeda60062e8133a32e0ac7a720f7cc65bde99605fe2316260ac34ec0bea9bf002aa4e602
7
- data.tar.gz: 6f77fceea6cc6e61d8054b14080b05c425d409e7121505ea6cecffe5d00adf635dfdd000702578e5991572d83b462cb94da3d29f1ffcf38046b70a4335c2654a
6
+ metadata.gz: 761eaa0a862661b6a6e50794f7ed4a7ff286eae058019abd49b70ec298dd0b5d1971a73e475da816114298007aadcf8eac59a90474c6988e66f541c99012ec80
7
+ data.tar.gz: ca7d0f0b8cbbfcd82d2543d769f6d92cd78b16ec8c397e5e1f226ebc490e7fc5199dd4e3956000326a93a8811a9fd7ba43c6b15bac0faf769168c097a3c1e3de
@@ -4,14 +4,19 @@ module SimpleCalendar
4
4
 
5
5
  attr_reader :block, :events, :options, :view_context
6
6
 
7
- def initialize(view_context, options={})
7
+ def initialize(view_context, opts={})
8
8
  @view_context = view_context
9
- @events = options.delete(:events) { [] }
10
- @options = options
11
- @options[:previous_link] ||= default_previous_link
12
- @options[:header] ||= default_header
13
- @options[:next_link] ||= default_next_link
14
- @options[:td] ||= default_td_classes
9
+ @events = opts.delete(:events) { [] }
10
+
11
+ opts.reverse_merge!(
12
+ previous_link: default_previous_link,
13
+ header: default_header,
14
+ next_link: default_next_link,
15
+ td: default_td_classes,
16
+ header_div: {class: "calendar-header"}
17
+ )
18
+
19
+ @options = opts
15
20
  end
16
21
 
17
22
  def render(block)
@@ -25,7 +30,7 @@ module SimpleCalendar
25
30
 
26
31
  def render_header
27
32
  capture do
28
- content_tag :div do
33
+ content_tag :div, get_option(:header_div) do
29
34
  concat get_option(:previous_link, param_name, date_range)
30
35
  concat get_option(:header, start_date)
31
36
  concat get_option(:next_link, param_name, date_range)
@@ -1,3 +1,3 @@
1
1
  module SimpleCalendar
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver