Class: WhirledPeas::Settings::Border

Inherits:
Object
  • Object
show all
Defined in:
lib/whirled_peas/settings/border.rb

Defined Under Namespace

Modules: Styles Classes: Style

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(theme) ⇒ Border

Returns a new instance of Border.



64
65
66
# File 'lib/whirled_peas/settings/border.rb', line 64

def initialize(theme)
  @theme = theme
end

Instance Attribute Details

#bottom=(value) ⇒ Object (writeonly)

Sets the attribute bottom

Parameters:

  • value

    the value to set the attribute bottom to.



62
63
64
# File 'lib/whirled_peas/settings/border.rb', line 62

def bottom=(value)
  @bottom = value
end

#inner_horiz=(value) ⇒ Object (writeonly)

Sets the attribute inner_horiz

Parameters:

  • value

    the value to set the attribute inner_horiz to.



62
63
64
# File 'lib/whirled_peas/settings/border.rb', line 62

def inner_horiz=(value)
  @inner_horiz = value
end

#inner_vert=(value) ⇒ Object (writeonly)

Sets the attribute inner_vert

Parameters:

  • value

    the value to set the attribute inner_vert to.



62
63
64
# File 'lib/whirled_peas/settings/border.rb', line 62

def inner_vert=(value)
  @inner_vert = value
end

#left=(value) ⇒ Object (writeonly)

Sets the attribute left

Parameters:

  • value

    the value to set the attribute left to.



62
63
64
# File 'lib/whirled_peas/settings/border.rb', line 62

def left=(value)
  @left = value
end

#right=(value) ⇒ Object (writeonly)

Sets the attribute right

Parameters:

  • value

    the value to set the attribute right to.



62
63
64
# File 'lib/whirled_peas/settings/border.rb', line 62

def right=(value)
  @right = value
end

#themeObject (readonly)

Returns the value of attribute theme.



60
61
62
# File 'lib/whirled_peas/settings/border.rb', line 60

def theme
  @theme
end

#top=(value) ⇒ Object (writeonly)

Sets the attribute top

Parameters:

  • value

    the value to set the attribute top to.



62
63
64
# File 'lib/whirled_peas/settings/border.rb', line 62

def top=(value)
  @top = value
end

Class Method Details

.inherit(parent) ⇒ Object



54
55
56
57
58
# File 'lib/whirled_peas/settings/border.rb', line 54

def self.inherit(parent)
  border = new(parent.theme)
  border.inherit(parent)
  border
end

Instance Method Details

#bottom?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/whirled_peas/settings/border.rb', line 80

def bottom?
  @bottom == true
end

#colorObject



108
109
110
# File 'lib/whirled_peas/settings/border.rb', line 108

def color
  @_color || theme.border_color
end

#color=(val) ⇒ Object



104
105
106
# File 'lib/whirled_peas/settings/border.rb', line 104

def color=(val)
  @_color = TextColor.validate!(val)
end

#inherit(parent) ⇒ Object



112
113
114
115
# File 'lib/whirled_peas/settings/border.rb', line 112

def inherit(parent)
  @_style = parent._style
  @_color = parent._color
end

#inner_horiz?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/whirled_peas/settings/border.rb', line 84

def inner_horiz?
  @inner_horiz == true
end

#inner_vert?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/whirled_peas/settings/border.rb', line 88

def inner_vert?
  @inner_vert == true
end

#left?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/whirled_peas/settings/border.rb', line 68

def left?
  @left == true
end

#outer?Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/whirled_peas/settings/border.rb', line 92

def outer?
  left? || top? || right? || bottom?
end

#right?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/whirled_peas/settings/border.rb', line 76

def right?
  @right == true
end

#styleObject



96
97
98
# File 'lib/whirled_peas/settings/border.rb', line 96

def style
  @_style || theme.border_style || Styles::DEFAULT
end

#style=(val) ⇒ Object



100
101
102
# File 'lib/whirled_peas/settings/border.rb', line 100

def style=(val)
  @_style = Styles.validate!(val)
end

#top?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/whirled_peas/settings/border.rb', line 72

def top?
  @top == true
end