Class: Nebula::WebClient::Border
- Inherits:
-
Object
- Object
- Nebula::WebClient::Border
- Defined in:
- lib/nebula/webclient/setting.rb
Overview
Border setting of the Nebula Viewer.
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#style ⇒ Object
Returns the value of attribute style.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Border
constructor
A new instance of Border.
-
#to_s ⇒ String
Convert the border setting to HTML string, e.g., “solid 1px #302903”.
Constructor Details
#initialize(args = {}) ⇒ Border
37 38 39 40 41 |
# File 'lib/nebula/webclient/setting.rb', line 37 def initialize(args = {}) @style = args[:style] || 'solid' @width = args[:width] || 0 @color = args[:color] || '#000' end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
51 52 53 |
# File 'lib/nebula/webclient/setting.rb', line 51 def color @color end |
#style ⇒ Object
Returns the value of attribute style.
49 50 51 |
# File 'lib/nebula/webclient/setting.rb', line 49 def style @style end |
#width ⇒ Object
Returns the value of attribute width.
50 51 52 |
# File 'lib/nebula/webclient/setting.rb', line 50 def width @width end |
Instance Method Details
#to_s ⇒ String
Convert the border setting to HTML string, e.g., “solid 1px #302903”.
45 46 47 |
# File 'lib/nebula/webclient/setting.rb', line 45 def to_s '' << style.to_s << ' ' << width.to_s << 'px ' << color.to_s end |