Class: Xmlss::Style::Font

Inherits:
Object
  • Object
show all
Includes:
Enumeration
Defined in:
lib/xmlss/style/font.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Font

Returns a new instance of Font.



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/xmlss/style/font.rb', line 22

def initialize(attrs={})
  self.bold = attrs[:bold] || false
  self.color = attrs[:color]
  self.italic = attrs[:italic] || false
  self.size = attrs[:size]
  self.strike_through = attrs[:strike_through] || false
  self.shadow = attrs[:shadow] || false
  self.underline = attrs[:underline]
  self.alignment = attrs[:alignment]
  self.name = attrs[:name]
end

Instance Attribute Details

#boldObject

Returns the value of attribute bold.



20
21
22
# File 'lib/xmlss/style/font.rb', line 20

def bold
  @bold
end

#colorObject

Returns the value of attribute color.



20
21
22
# File 'lib/xmlss/style/font.rb', line 20

def color
  @color
end

#italicObject

Returns the value of attribute italic.



20
21
22
# File 'lib/xmlss/style/font.rb', line 20

def italic
  @italic
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/xmlss/style/font.rb', line 20

def name
  @name
end

#shadowObject

Returns the value of attribute shadow.



20
21
22
# File 'lib/xmlss/style/font.rb', line 20

def shadow
  @shadow
end

#sizeObject

Returns the value of attribute size.



20
21
22
# File 'lib/xmlss/style/font.rb', line 20

def size
  @size
end

#strike_throughObject

Returns the value of attribute strike_through.



20
21
22
# File 'lib/xmlss/style/font.rb', line 20

def strike_through
  @strike_through
end

Class Method Details

.writerObject



6
# File 'lib/xmlss/style/font.rb', line 6

def self.writer; :font; end

Instance Method Details

#bold?Boolean

Returns:

  • (Boolean)


34
# File 'lib/xmlss/style/font.rb', line 34

def bold?; !!self.bold; end

#italic?Boolean

Returns:

  • (Boolean)


35
# File 'lib/xmlss/style/font.rb', line 35

def italic?; !!self.italic; end

#shadow?Boolean

Returns:

  • (Boolean)


37
# File 'lib/xmlss/style/font.rb', line 37

def shadow?; !!self.shadow; end

#strike_through?Boolean

Returns:

  • (Boolean)


36
# File 'lib/xmlss/style/font.rb', line 36

def strike_through?; !!self.strike_through; end