Class: Font
- Inherits:
-
Object
- Object
- Font
- Defined in:
- lib/font.rb
Overview
TODO: Need to support an array of font names
... should Font#name return the first available font,
or should it return the array?
Class Attribute Summary collapse
-
.default_bold ⇒ Object
Returns the value of attribute default_bold.
-
.default_color ⇒ Object
Returns the value of attribute default_color.
-
.default_italic ⇒ Object
Returns the value of attribute default_italic.
-
.default_name ⇒ Object
Returns the value of attribute default_name.
-
.default_size ⇒ Object
Returns the value of attribute default_size.
Instance Attribute Summary collapse
-
#bold ⇒ Object
Returns the value of attribute bold.
-
#color ⇒ Object
Returns the value of attribute color.
-
#italic ⇒ Object
Returns the value of attribute italic.
-
#name ⇒ Object
Returns the value of attribute name.
-
#size ⇒ Object
Returns the value of attribute size.
Class Method Summary collapse
-
.exist?(name) ⇒ Boolean
Returns TRUE when the specified font exists within the system.
Instance Method Summary collapse
-
#initialize(name = nil, size = nil) ⇒ Font
constructor
Creates a Font object.
Constructor Details
#initialize(name = nil, size = nil) ⇒ Font
Creates a Font object.
10 11 12 13 14 15 16 |
# File 'lib/font.rb', line 10 def initialize(name=nil, size=nil) @name = name || Font.default_name @size = size || Font.default_size @bold = Font.default_bold @italic = Font.default_italic @color = Font.default_color end |
Class Attribute Details
.default_bold ⇒ Object
Returns the value of attribute default_bold.
31 32 33 |
# File 'lib/font.rb', line 31 def default_bold @default_bold end |
.default_color ⇒ Object
Returns the value of attribute default_color.
31 32 33 |
# File 'lib/font.rb', line 31 def default_color @default_color end |
.default_italic ⇒ Object
Returns the value of attribute default_italic.
31 32 33 |
# File 'lib/font.rb', line 31 def default_italic @default_italic end |
.default_name ⇒ Object
Returns the value of attribute default_name.
31 32 33 |
# File 'lib/font.rb', line 31 def default_name @default_name end |
.default_size ⇒ Object
Returns the value of attribute default_size.
31 32 33 |
# File 'lib/font.rb', line 31 def default_size @default_size end |
Instance Attribute Details
#bold ⇒ Object
Returns the value of attribute bold.
7 8 9 |
# File 'lib/font.rb', line 7 def bold @bold end |
#color ⇒ Object
Returns the value of attribute color.
7 8 9 |
# File 'lib/font.rb', line 7 def color @color end |
#italic ⇒ Object
Returns the value of attribute italic.
7 8 9 |
# File 'lib/font.rb', line 7 def italic @italic end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/font.rb', line 7 def name @name end |
#size ⇒ Object
Returns the value of attribute size.
7 8 9 |
# File 'lib/font.rb', line 7 def size @size end |
Class Method Details
.exist?(name) ⇒ Boolean
Returns TRUE when the specified font exists within the system.
19 20 21 |
# File 'lib/font.rb', line 19 def self.exist?(name) raise "not implemented" end |