caracal 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +941 -0
- data/Rakefile +2 -0
- data/caracal.gemspec +27 -0
- data/lib/caracal.rb +31 -0
- data/lib/caracal/core/file_name.rb +39 -0
- data/lib/caracal/core/fonts.rb +75 -0
- data/lib/caracal/core/images.rb +37 -0
- data/lib/caracal/core/line_breaks.rb +29 -0
- data/lib/caracal/core/list_styles.rb +92 -0
- data/lib/caracal/core/lists.rb +57 -0
- data/lib/caracal/core/models/base_model.rb +51 -0
- data/lib/caracal/core/models/border_model.rb +120 -0
- data/lib/caracal/core/models/font_model.rb +64 -0
- data/lib/caracal/core/models/image_model.rb +118 -0
- data/lib/caracal/core/models/line_break_model.rb +15 -0
- data/lib/caracal/core/models/link_model.rb +65 -0
- data/lib/caracal/core/models/list_item_model.rb +105 -0
- data/lib/caracal/core/models/list_model.rb +130 -0
- data/lib/caracal/core/models/list_style_model.rb +129 -0
- data/lib/caracal/core/models/margin_model.rb +76 -0
- data/lib/caracal/core/models/page_break_model.rb +15 -0
- data/lib/caracal/core/models/page_number_model.rb +69 -0
- data/lib/caracal/core/models/page_size_model.rb +70 -0
- data/lib/caracal/core/models/paragraph_model.rb +141 -0
- data/lib/caracal/core/models/relationship_model.rb +108 -0
- data/lib/caracal/core/models/rule_model.rb +27 -0
- data/lib/caracal/core/models/style_model.rb +134 -0
- data/lib/caracal/core/models/table_cell_model.rb +155 -0
- data/lib/caracal/core/models/table_model.rb +206 -0
- data/lib/caracal/core/models/text_model.rb +92 -0
- data/lib/caracal/core/page_breaks.rb +29 -0
- data/lib/caracal/core/page_numbers.rb +51 -0
- data/lib/caracal/core/page_settings.rb +72 -0
- data/lib/caracal/core/relationships.rb +90 -0
- data/lib/caracal/core/rules.rb +35 -0
- data/lib/caracal/core/styles.rb +86 -0
- data/lib/caracal/core/tables.rb +41 -0
- data/lib/caracal/core/text.rb +73 -0
- data/lib/caracal/document.rb +242 -0
- data/lib/caracal/errors.rb +23 -0
- data/lib/caracal/renderers/app_renderer.rb +41 -0
- data/lib/caracal/renderers/content_types_renderer.rb +53 -0
- data/lib/caracal/renderers/core_renderer.rb +44 -0
- data/lib/caracal/renderers/document_renderer.rb +349 -0
- data/lib/caracal/renderers/fonts_renderer.rb +56 -0
- data/lib/caracal/renderers/footer_renderer.rb +69 -0
- data/lib/caracal/renderers/numbering_renderer.rb +87 -0
- data/lib/caracal/renderers/package_relationships_renderer.rb +50 -0
- data/lib/caracal/renderers/relationships_renderer.rb +48 -0
- data/lib/caracal/renderers/settings_renderer.rb +58 -0
- data/lib/caracal/renderers/styles_renderer.rb +163 -0
- data/lib/caracal/renderers/xml_renderer.rb +83 -0
- data/lib/caracal/version.rb +3 -0
- data/lib/tilt/caracal.rb +21 -0
- data/spec/lib/caracal/core/file_name_spec.rb +54 -0
- data/spec/lib/caracal/core/fonts_spec.rb +119 -0
- data/spec/lib/caracal/core/images_spec.rb +25 -0
- data/spec/lib/caracal/core/line_breaks_spec.rb +25 -0
- data/spec/lib/caracal/core/list_styles_spec.rb +121 -0
- data/spec/lib/caracal/core/lists_spec.rb +43 -0
- data/spec/lib/caracal/core/models/base_model_spec.rb +38 -0
- data/spec/lib/caracal/core/models/border_model_spec.rb +159 -0
- data/spec/lib/caracal/core/models/font_model_spec.rb +92 -0
- data/spec/lib/caracal/core/models/image_model_spec.rb +192 -0
- data/spec/lib/caracal/core/models/line_break_model_spec.rb +21 -0
- data/spec/lib/caracal/core/models/link_model_spec.rb +139 -0
- data/spec/lib/caracal/core/models/list_item_model_spec.rb +190 -0
- data/spec/lib/caracal/core/models/list_model_spec.rb +178 -0
- data/spec/lib/caracal/core/models/list_style_model_spec.rb +212 -0
- data/spec/lib/caracal/core/models/margin_model_spec.rb +111 -0
- data/spec/lib/caracal/core/models/page_break_model_spec.rb +21 -0
- data/spec/lib/caracal/core/models/page_number_model_spec.rb +101 -0
- data/spec/lib/caracal/core/models/page_size_model_spec.rb +91 -0
- data/spec/lib/caracal/core/models/paragraph_model_spec.rb +162 -0
- data/spec/lib/caracal/core/models/relationship_model_spec.rb +183 -0
- data/spec/lib/caracal/core/models/rule_model_spec.rb +108 -0
- data/spec/lib/caracal/core/models/style_model_spec.rb +187 -0
- data/spec/lib/caracal/core/models/table_cell_model_spec.rb +221 -0
- data/spec/lib/caracal/core/models/table_model_spec.rb +222 -0
- data/spec/lib/caracal/core/models/text_model_spec.rb +132 -0
- data/spec/lib/caracal/core/page_breaks_spec.rb +25 -0
- data/spec/lib/caracal/core/page_numbers_spec.rb +80 -0
- data/spec/lib/caracal/core/page_settings_spec.rb +143 -0
- data/spec/lib/caracal/core/relationships_spec.rb +119 -0
- data/spec/lib/caracal/core/rules_spec.rb +25 -0
- data/spec/lib/caracal/core/styles_spec.rb +129 -0
- data/spec/lib/caracal/core/tables_spec.rb +25 -0
- data/spec/lib/caracal/core/text_spec.rb +52 -0
- data/spec/lib/caracal/errors_spec.rb +10 -0
- data/spec/spec_helper.rb +8 -0
- metadata +245 -0
@@ -0,0 +1,130 @@
|
|
1
|
+
require 'caracal/core/models/base_model'
|
2
|
+
require 'caracal/core/models/list_item_model'
|
3
|
+
require 'caracal/errors'
|
4
|
+
|
5
|
+
|
6
|
+
module Caracal
|
7
|
+
module Core
|
8
|
+
module Models
|
9
|
+
|
10
|
+
# This class encapsulates the logic needed to store and manipulate
|
11
|
+
# list data.
|
12
|
+
#
|
13
|
+
class ListModel < BaseModel
|
14
|
+
|
15
|
+
#-------------------------------------------------------------
|
16
|
+
# Configuration
|
17
|
+
#-------------------------------------------------------------
|
18
|
+
|
19
|
+
# constants
|
20
|
+
const_set(:DEFAULT_LIST_TYPE, :unordered)
|
21
|
+
const_set(:DEFAULT_LIST_LEVEL, 0)
|
22
|
+
|
23
|
+
# accessors
|
24
|
+
attr_reader :list_type
|
25
|
+
attr_reader :list_level
|
26
|
+
|
27
|
+
|
28
|
+
# initialization
|
29
|
+
def initialize(**options, &block)
|
30
|
+
@list_type = DEFAULT_LIST_TYPE
|
31
|
+
@list_level = DEFAULT_LIST_LEVEL
|
32
|
+
|
33
|
+
super options, &block
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
#-------------------------------------------------------------
|
38
|
+
# Public Instance Methods
|
39
|
+
#-------------------------------------------------------------
|
40
|
+
|
41
|
+
#=============== GETTERS ==============================
|
42
|
+
|
43
|
+
# This method returns only those items owned directly
|
44
|
+
# by this list.
|
45
|
+
#
|
46
|
+
def items
|
47
|
+
@items ||= []
|
48
|
+
end
|
49
|
+
|
50
|
+
# This method returns a hash, where the keys are levels
|
51
|
+
# and the values are the list type at that level.
|
52
|
+
#
|
53
|
+
def level_map
|
54
|
+
recursive_items.reduce({}) do |hash, item|
|
55
|
+
hash[item.list_item_level] = item.list_item_type
|
56
|
+
hash
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# This method returns a flattened array containing every
|
61
|
+
# item within this list's tree.
|
62
|
+
#
|
63
|
+
def recursive_items
|
64
|
+
items.map do |model|
|
65
|
+
if model.nested_list.nil?
|
66
|
+
model
|
67
|
+
else
|
68
|
+
[model, model.nested_list.recursive_items]
|
69
|
+
end
|
70
|
+
end.flatten
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
#=============== SETTERS ==============================
|
75
|
+
|
76
|
+
# integers
|
77
|
+
[:level].each do |m|
|
78
|
+
define_method "#{ m }" do |value|
|
79
|
+
instance_variable_set("@list_#{ m }", value.to_i)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# symbols
|
84
|
+
[:type].each do |m|
|
85
|
+
define_method "#{ m }" do |value|
|
86
|
+
instance_variable_set("@list_#{ m }", value.to_s.to_sym)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
#=============== SUB-METHODS ===========================
|
92
|
+
|
93
|
+
# .li
|
94
|
+
def li(*args, **options, &block)
|
95
|
+
options.merge!({ content: args[0] }) unless args[0].nil?
|
96
|
+
options.merge!({ type: list_type })
|
97
|
+
options.merge!({ level: list_level })
|
98
|
+
|
99
|
+
model = Caracal::Core::Models::ListItemModel.new(options, &block)
|
100
|
+
if model.valid?
|
101
|
+
items << model
|
102
|
+
else
|
103
|
+
raise Caracal::Errors::InvalidModelError, 'List item must have at least one run.'
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
#=============== VALIDATION ===========================
|
109
|
+
|
110
|
+
def valid?
|
111
|
+
a = [:type, :level]
|
112
|
+
required = a.map { |m| send("list_#{ m }") }.compact.size == a.size
|
113
|
+
required && !items.empty?
|
114
|
+
end
|
115
|
+
|
116
|
+
|
117
|
+
#-------------------------------------------------------------
|
118
|
+
# Private Instance Methods
|
119
|
+
#-------------------------------------------------------------
|
120
|
+
private
|
121
|
+
|
122
|
+
def option_keys
|
123
|
+
[:type, :level]
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
module Caracal
|
2
|
+
module Core
|
3
|
+
module Models
|
4
|
+
|
5
|
+
# This class encapsulates the logic needed to store and manipulate
|
6
|
+
# list style data.
|
7
|
+
#
|
8
|
+
class ListStyleModel < BaseModel
|
9
|
+
|
10
|
+
#-------------------------------------------------------------
|
11
|
+
# Configuration
|
12
|
+
#-------------------------------------------------------------
|
13
|
+
|
14
|
+
# constants
|
15
|
+
const_set(:TYPE_MAP, { ordered: 1, unordered: 2 })
|
16
|
+
const_set(:DEFAULT_STYLE_LEFT, 720) # units in twips
|
17
|
+
const_set(:DEFAULT_STYLE_LINE, 360) # units in twips
|
18
|
+
const_set(:DEFAULT_STYLE_ALIGN, :left)
|
19
|
+
const_set(:DEFAULT_STYLE_START, 1)
|
20
|
+
const_set(:DEFAULT_STYLE_RESTART, true)
|
21
|
+
|
22
|
+
# accessors
|
23
|
+
attr_reader :style_type
|
24
|
+
attr_reader :style_level
|
25
|
+
attr_reader :style_format
|
26
|
+
attr_reader :style_value
|
27
|
+
attr_reader :style_start
|
28
|
+
attr_reader :style_align
|
29
|
+
attr_reader :style_left
|
30
|
+
attr_reader :style_line
|
31
|
+
attr_reader :style_restart
|
32
|
+
|
33
|
+
|
34
|
+
# initialization
|
35
|
+
def initialize(**options, &block)
|
36
|
+
@style_align = DEFAULT_STYLE_ALIGN
|
37
|
+
@style_left = DEFAULT_STYLE_LEFT
|
38
|
+
@style_line = DEFAULT_STYLE_LINE
|
39
|
+
@style_start = DEFAULT_STYLE_START
|
40
|
+
@style_restart = DEFAULT_STYLE_RESTART
|
41
|
+
|
42
|
+
super options, &block
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
#-------------------------------------------------------------
|
47
|
+
# Public Class Methods
|
48
|
+
#-------------------------------------------------------------
|
49
|
+
|
50
|
+
def self.formatted_type(type)
|
51
|
+
TYPE_MAP.fetch(type.to_s.to_sym)
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
#-------------------------------------------------------------
|
56
|
+
# Public Instance Methods
|
57
|
+
#-------------------------------------------------------------
|
58
|
+
|
59
|
+
#=============== GETTERS ==============================
|
60
|
+
|
61
|
+
def formatted_type
|
62
|
+
self.class.formatted_type(style_type)
|
63
|
+
end
|
64
|
+
|
65
|
+
def formatted_restart
|
66
|
+
v = style_restart ? '1' : '0'
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
#=============== SETTERS ==============================
|
71
|
+
|
72
|
+
# booleans
|
73
|
+
[:restart].each do |m|
|
74
|
+
define_method "#{ m }" do |value|
|
75
|
+
instance_variable_set("@style_#{ m }", !!value)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# integers
|
80
|
+
[:level, :left, :line, :start].each do |m|
|
81
|
+
define_method "#{ m }" do |value|
|
82
|
+
instance_variable_set("@style_#{ m }", value.to_i)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# strings
|
87
|
+
[:format, :value].each do |m|
|
88
|
+
define_method "#{ m }" do |value|
|
89
|
+
instance_variable_set("@style_#{ m }", value.to_s)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# symbols
|
94
|
+
[:type, :align].each do |m|
|
95
|
+
define_method "#{ m }" do |value|
|
96
|
+
instance_variable_set("@style_#{ m }", value.to_s.to_sym)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
#=============== STATE ================================
|
102
|
+
|
103
|
+
def matches?(type, level)
|
104
|
+
style_type == type.to_s.to_sym && style_level == level.to_i
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
#=============== VALIDATION ===========================
|
109
|
+
|
110
|
+
def valid?
|
111
|
+
a = [:type, :level, :format, :value]
|
112
|
+
a.map { |m| send("style_#{ m }") }.compact.size == a.size
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
#-------------------------------------------------------------
|
117
|
+
# Private Instance Methods
|
118
|
+
#-------------------------------------------------------------
|
119
|
+
private
|
120
|
+
|
121
|
+
def option_keys
|
122
|
+
[:type, :level, :format, :value, :align, :left, :line, :start]
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'caracal/core/models/base_model'
|
2
|
+
|
3
|
+
|
4
|
+
module Caracal
|
5
|
+
module Core
|
6
|
+
module Models
|
7
|
+
|
8
|
+
# This class handles block options passed to the margins
|
9
|
+
# method.
|
10
|
+
#
|
11
|
+
class MarginModel < BaseModel
|
12
|
+
|
13
|
+
#-------------------------------------------------------------
|
14
|
+
# Configuration
|
15
|
+
#-------------------------------------------------------------
|
16
|
+
|
17
|
+
# constants
|
18
|
+
const_set(:DEFAULT_MARGIN_TOP, 0) # units in twips
|
19
|
+
const_set(:DEFAULT_MARGIN_BOTTOM, 0) # units in twips
|
20
|
+
const_set(:DEFAULT_MARGIN_LEFT, 0) # units in twips
|
21
|
+
const_set(:DEFAULT_MARGIN_RIGHT, 0) # units in twips
|
22
|
+
|
23
|
+
# accessors
|
24
|
+
attr_reader :margin_top
|
25
|
+
attr_reader :margin_bottom
|
26
|
+
attr_reader :margin_left
|
27
|
+
attr_reader :margin_right
|
28
|
+
|
29
|
+
|
30
|
+
# initialization
|
31
|
+
def initialize(**options, &block)
|
32
|
+
@margin_top = DEFAULT_MARGIN_TOP
|
33
|
+
@margin_bottom = DEFAULT_MARGIN_BOTTOM
|
34
|
+
@margin_left = DEFAULT_MARGIN_LEFT
|
35
|
+
@margin_right = DEFAULT_MARGIN_RIGHT
|
36
|
+
|
37
|
+
super options, &block
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
#-------------------------------------------------------------
|
42
|
+
# Public Methods
|
43
|
+
#-------------------------------------------------------------
|
44
|
+
|
45
|
+
#=============== SETTERS ==============================
|
46
|
+
|
47
|
+
# integers
|
48
|
+
[:bottom, :left, :right, :top].each do |m|
|
49
|
+
define_method "#{ m }" do |value|
|
50
|
+
instance_variable_set("@margin_#{ m }", value.to_i)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
#=============== VALIDATION ==============================
|
56
|
+
|
57
|
+
def valid?
|
58
|
+
dims = [:bottom, :left, :right, :top]
|
59
|
+
dims.map { |d| send("margin_#{ d }") }.all? { |d| d > 0 }
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
#-------------------------------------------------------------
|
64
|
+
# Private Instance Methods
|
65
|
+
#-------------------------------------------------------------
|
66
|
+
private
|
67
|
+
|
68
|
+
def option_keys
|
69
|
+
[:top, :bottom, :left, :right]
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'caracal/core/models/base_model'
|
2
|
+
|
3
|
+
|
4
|
+
module Caracal
|
5
|
+
module Core
|
6
|
+
module Models
|
7
|
+
|
8
|
+
# This class encapsulates the logic needed to store and manipulate
|
9
|
+
# page break data.
|
10
|
+
#
|
11
|
+
class PageBreakModel < BaseModel; end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'caracal/core/models/base_model'
|
2
|
+
|
3
|
+
|
4
|
+
module Caracal
|
5
|
+
module Core
|
6
|
+
module Models
|
7
|
+
|
8
|
+
# This class handles block options passed to the page_numbers
|
9
|
+
# method.
|
10
|
+
#
|
11
|
+
class PageNumberModel < BaseModel
|
12
|
+
|
13
|
+
#-------------------------------------------------------------
|
14
|
+
# Configuration
|
15
|
+
#-------------------------------------------------------------
|
16
|
+
|
17
|
+
# constants
|
18
|
+
const_set(:DEFAULT_PAGE_NUMBER_SHOW, false)
|
19
|
+
const_set(:DEFAULT_PAGE_NUMBER_ALIGN, :center)
|
20
|
+
|
21
|
+
# accessors
|
22
|
+
attr_reader :page_number_align
|
23
|
+
attr_reader :page_number_show
|
24
|
+
|
25
|
+
# initialization
|
26
|
+
def initialize(**options, &block)
|
27
|
+
@page_number_show = DEFAULT_PAGE_NUMBER_SHOW
|
28
|
+
@page_number_align = DEFAULT_PAGE_NUMBER_ALIGN
|
29
|
+
|
30
|
+
super options, &block
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
#-------------------------------------------------------------
|
35
|
+
# Public Methods
|
36
|
+
#-------------------------------------------------------------
|
37
|
+
|
38
|
+
#=============== SETTERS ==============================
|
39
|
+
|
40
|
+
def align(value)
|
41
|
+
@page_number_align = value.to_s.to_sym
|
42
|
+
end
|
43
|
+
|
44
|
+
def show(value)
|
45
|
+
@page_number_show = !!value
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
#=============== VALIDATION ===========================
|
50
|
+
|
51
|
+
def valid?
|
52
|
+
(!page_number_show || [:left, :center, :right].include?(page_number_align))
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
#-------------------------------------------------------------
|
57
|
+
# Private Instance Methods
|
58
|
+
#-------------------------------------------------------------
|
59
|
+
private
|
60
|
+
|
61
|
+
def option_keys
|
62
|
+
[:align, :show]
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'caracal/core/models/base_model'
|
2
|
+
|
3
|
+
|
4
|
+
module Caracal
|
5
|
+
module Core
|
6
|
+
module Models
|
7
|
+
|
8
|
+
# This class handles block options passed to the page size
|
9
|
+
# method.
|
10
|
+
#
|
11
|
+
class PageSizeModel < BaseModel
|
12
|
+
|
13
|
+
#-------------------------------------------------------------
|
14
|
+
# Configuration
|
15
|
+
#-------------------------------------------------------------
|
16
|
+
|
17
|
+
# constants
|
18
|
+
const_set(:DEFAULT_PAGE_WIDTH, 12240) # 8.5in in twips
|
19
|
+
const_set(:DEFAULT_PAGE_HEIGHT, 15840) # 11.0in in twips
|
20
|
+
|
21
|
+
# accessors
|
22
|
+
attr_reader :page_width
|
23
|
+
attr_reader :page_height
|
24
|
+
|
25
|
+
# initialization
|
26
|
+
def initialize(**options, &block)
|
27
|
+
@page_width = DEFAULT_PAGE_WIDTH
|
28
|
+
@page_height = DEFAULT_PAGE_HEIGHT
|
29
|
+
|
30
|
+
super options, &block
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
#-------------------------------------------------------------
|
35
|
+
# Public Methods
|
36
|
+
#-------------------------------------------------------------
|
37
|
+
|
38
|
+
#=============== SETTERS ==============================
|
39
|
+
|
40
|
+
def height(value)
|
41
|
+
@page_height = value.to_i
|
42
|
+
end
|
43
|
+
|
44
|
+
def width(value)
|
45
|
+
@page_width = value.to_i
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
#=============== VALIDATION ==============================
|
50
|
+
|
51
|
+
def valid?
|
52
|
+
dims = [page_width, page_height]
|
53
|
+
dims.all? { |d| d > 0 }
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
#-------------------------------------------------------------
|
58
|
+
# Private Instance Methods
|
59
|
+
#-------------------------------------------------------------
|
60
|
+
private
|
61
|
+
|
62
|
+
def option_keys
|
63
|
+
[:width, :height]
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|