Class: ButtonModel

Inherits:
Object
  • Object
show all
Defined in:
lib/glimmer-dsl-web/samples/hello/hello_style.rb

Constant Summary collapse

WIDTH_MIN =
160
WIDTH_MAX =
960
HEIGHT_MIN =
100
HEIGHT_MAX =
600
FONT_SIZE_MIN =
40
FONT_SIZE_MAX =
200

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeButtonModel

Returns a new instance of ButtonModel.



34
35
36
37
38
39
# File 'lib/glimmer-dsl-web/samples/hello/hello_style.rb', line 34

def initialize
  @text = 'Push'
  @width = WIDTH_MIN
  @height = HEIGHT_MIN
  @font_size = FONT_SIZE_MIN
end

Instance Attribute Details

#font_sizeObject

Returns the value of attribute font_size.



32
33
34
# File 'lib/glimmer-dsl-web/samples/hello/hello_style.rb', line 32

def font_size
  @font_size
end

#heightObject

Returns the value of attribute height.



32
33
34
# File 'lib/glimmer-dsl-web/samples/hello/hello_style.rb', line 32

def height
  @height
end

#pushedObject

Returns the value of attribute pushed.



32
33
34
# File 'lib/glimmer-dsl-web/samples/hello/hello_style.rb', line 32

def pushed
  @pushed
end

#textObject

Returns the value of attribute text.



32
33
34
# File 'lib/glimmer-dsl-web/samples/hello/hello_style.rb', line 32

def text
  @text
end

#widthObject

Returns the value of attribute width.



32
33
34
# File 'lib/glimmer-dsl-web/samples/hello/hello_style.rb', line 32

def width
  @width
end

Instance Method Details

#pushObject



41
42
43
# File 'lib/glimmer-dsl-web/samples/hello/hello_style.rb', line 41

def push
  self.pushed = !pushed
end