Class: Hyde::FontVariant
- Inherits:
-
Object
- Object
- Hyde::FontVariant
- Defined in:
- lib/hyde_fonts/font_variant.rb
Instance Attribute Summary collapse
-
#italic ⇒ Object
readonly
Returns the value of attribute italic.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(weight:, italic:) ⇒ FontVariant
constructor
A new instance of FontVariant.
- #to_s ⇒ Object
Constructor Details
#initialize(weight:, italic:) ⇒ FontVariant
Returns a new instance of FontVariant.
5 6 7 8 9 10 11 12 |
# File 'lib/hyde_fonts/font_variant.rb', line 5 def initialize(weight:, italic:) @weight = weight @italic = 0 if italic == true @italic = 1 end end |
Instance Attribute Details
#italic ⇒ Object (readonly)
Returns the value of attribute italic.
3 4 5 |
# File 'lib/hyde_fonts/font_variant.rb', line 3 def italic @italic end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
3 4 5 |
# File 'lib/hyde_fonts/font_variant.rb', line 3 def weight @weight end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/hyde_fonts/font_variant.rb', line 14 def to_s @italic.to_s + "," + @weight.to_s end |