Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/ironnails/core_ext/symbol.rb

Instance Method Summary collapse

Instance Method Details

#to_binding_modeObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/ironnails/core_ext/symbol.rb', line 64

def to_binding_mode
  case self
    when :default
      BindingMode.default
    when :one_time
      BindingMode.one_time
    when :one_way
      BindingMode.one_way
    when :one_way_to_source
      BindingMode.one_way_to_source
    when :two_way
      BindingMode.two_way
  end
end

#to_brushObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ironnails/core_ext/symbol.rb', line 3

def to_brush
  case self
    when :black
      Brushes.black
    when :white
      Brushes.white
    when :green
      Brushes.green
    when :alice_blue
      Brushes.alice_blue
    when :red
      Brushes.red
  end
end

#to_horizontal_alignmentObject



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/ironnails/core_ext/symbol.rb', line 51

def to_horizontal_alignment
  case self
    when :center
      HorizontalAlignment.center
    when :left
      HorizontalAlignment.left
    when :right
      HorizontalAlignment.right
    when :stretch
      HorizontalAlignment.stretch
  end
end

#to_orientationObject



18
19
20
21
22
23
24
25
# File 'lib/ironnails/core_ext/symbol.rb', line 18

def to_orientation
  case self
    when :horizontal
      Orientation.horizontal
    when :vertical
      Orientation.vertical
  end
end

#to_vertical_alignmentObject



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/ironnails/core_ext/symbol.rb', line 38

def to_vertical_alignment
  case self
    when :center
      VerticalAlignment.center
    when :top
      VerticalAlignment.top
    when :bottom
      VerticalAlignment.bottom
    when :stretch
      VerticalAlignment.strecht
  end
end

#to_visibilityObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/ironnails/core_ext/symbol.rb', line 27

def to_visibility
  case self
    when :visible
      Visibility.visible
    when :hidden
      Visibility.hidden
    when :collapsed
      Visibility.collapsed
  end
end