Module: SurveyMetamodel::Style::ClassModule
- Defined in:
- lib/generators/survey/metamodels/style.rb
Instance Method Summary collapse
- #background? ⇒ Boolean
- #background_color ⇒ Object
- #font_size? ⇒ Boolean
- #font_style? ⇒ Boolean
- #font_weight? ⇒ Boolean
- #foreground? ⇒ Boolean
- #foreground_color ⇒ Object
- #horizontal_align ⇒ Object
- #horizontal_alignment? ⇒ Boolean
- #margin? ⇒ Boolean
- #padding? ⇒ Boolean
- #style ⇒ Object
- #vertical_align ⇒ Object
- #vertical_alignment? ⇒ Boolean
- #weight ⇒ Object
Instance Method Details
#background? ⇒ Boolean
61 62 63 |
# File 'lib/generators/survey/metamodels/style.rb', line 61 def background? !background.nil? end |
#background_color ⇒ Object
89 90 91 |
# File 'lib/generators/survey/metamodels/style.rb', line 89 def background_color color(background) end |
#font_size? ⇒ Boolean
65 66 67 |
# File 'lib/generators/survey/metamodels/style.rb', line 65 def font_size? !font_size.nil? and (font_size != 0) end |
#font_style? ⇒ Boolean
69 70 71 |
# File 'lib/generators/survey/metamodels/style.rb', line 69 def font_style? !style.nil? end |
#font_weight? ⇒ Boolean
73 74 75 |
# File 'lib/generators/survey/metamodels/style.rb', line 73 def font_weight? !weight.nil? end |
#foreground? ⇒ Boolean
57 58 59 |
# File 'lib/generators/survey/metamodels/style.rb', line 57 def foreground? !foreground.nil? end |
#foreground_color ⇒ Object
85 86 87 |
# File 'lib/generators/survey/metamodels/style.rb', line 85 def foreground_color color(foreground) end |
#horizontal_align ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/generators/survey/metamodels/style.rb', line 108 def horizontal_align case horizontal_alignment when :left then "left" when :center then "center" when :right then "right" end end |
#horizontal_alignment? ⇒ Boolean
77 78 79 |
# File 'lib/generators/survey/metamodels/style.rb', line 77 def horizontal_alignment? !horizontal_align.nil? end |
#margin? ⇒ Boolean
49 50 51 |
# File 'lib/generators/survey/metamodels/style.rb', line 49 def margin? !margin.nil? and (margin != 0) end |
#padding? ⇒ Boolean
53 54 55 |
# File 'lib/generators/survey/metamodels/style.rb', line 53 def padding? !padding.nil? and (margin != 0) end |
#style ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/generators/survey/metamodels/style.rb', line 93 def style case font_style when :normal then "normal" when :italic then "italic" when :oblique then "oblique" end end |
#vertical_align ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/generators/survey/metamodels/style.rb', line 116 def vertical_align case vertical_alignment when :top then "top" when :middle then "middle" when :bottom then "bottom" end end |
#vertical_alignment? ⇒ Boolean
81 82 83 |
# File 'lib/generators/survey/metamodels/style.rb', line 81 def vertical_alignment? !vertical_align.nil? end |
#weight ⇒ Object
101 102 103 104 105 106 |
# File 'lib/generators/survey/metamodels/style.rb', line 101 def weight case font_weight when :normal then "normal" when :bold then "bold" end end |