Class: Nebula::WebClient::Border

Inherits:
Object
  • Object
show all
Defined in:
lib/nebula/webclient/setting.rb

Overview

Border setting of the Nebula Viewer.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#colorObject

Returns the value of attribute color.



51
52
53
# File 'lib/nebula/webclient/setting.rb', line 51

def color
  @color
end

#styleObject

Returns the value of attribute style.



49
50
51
# File 'lib/nebula/webclient/setting.rb', line 49

def style
  @style
end

#widthObject

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_sString

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