Module: SurveyMetamodel::Style::ClassModule

Defined in:
lib/generators/survey/metamodels/style.rb

Instance Method Summary collapse

Instance Method Details

#background?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/generators/survey/metamodels/style.rb', line 61

def background?
  !background.nil?
end

#background_colorObject



89
90
91
# File 'lib/generators/survey/metamodels/style.rb', line 89

def background_color
  color(background)
end

#font_size?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


69
70
71
# File 'lib/generators/survey/metamodels/style.rb', line 69

def font_style?
  !style.nil?
end

#font_weight?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/generators/survey/metamodels/style.rb', line 73

def font_weight?
  !weight.nil?
end

#foreground?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/generators/survey/metamodels/style.rb', line 57

def foreground?
  !foreground.nil?
end

#foreground_colorObject



85
86
87
# File 'lib/generators/survey/metamodels/style.rb', line 85

def foreground_color
  color(foreground)
end

#horizontal_alignObject



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

Returns:

  • (Boolean)


77
78
79
# File 'lib/generators/survey/metamodels/style.rb', line 77

def horizontal_alignment?
  !horizontal_align.nil?
end

#margin?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/generators/survey/metamodels/style.rb', line 49

def margin?
  !margin.nil? and (margin != 0)
end

#padding?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/generators/survey/metamodels/style.rb', line 53

def padding?
  !padding.nil? and (margin != 0)
end

#styleObject



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_alignObject



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

Returns:

  • (Boolean)


81
82
83
# File 'lib/generators/survey/metamodels/style.rb', line 81

def vertical_alignment?
  !vertical_align.nil?
end

#weightObject



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