Class: Plushie::Type::Font::Spec
- Inherits:
-
Data
- Object
- Data
- Plushie::Type::Font::Spec
- Defined in:
- lib/plushie/type/font.rb
Overview
Immutable spec; use #with to create modified copies.
Instance Attribute Summary collapse
-
#family ⇒ Object
readonly
Returns the value of attribute family.
-
#stretch ⇒ Object
readonly
Returns the value of attribute stretch.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(family: nil, weight: nil, style: nil, stretch: nil) ⇒ Spec
constructor
A new instance of Spec.
-
#with(**changes) ⇒ Object
Returns a copy with the given fields updated.
Constructor Details
#initialize(family: nil, weight: nil, style: nil, stretch: nil) ⇒ Spec
Returns a new instance of Spec.
30 31 32 |
# File 'lib/plushie/type/font.rb', line 30 def initialize(family: nil, weight: nil, style: nil, stretch: nil) super end |
Instance Attribute Details
#family ⇒ Object (readonly)
Returns the value of attribute family
29 30 31 |
# File 'lib/plushie/type/font.rb', line 29 def family @family end |
#stretch ⇒ Object (readonly)
Returns the value of attribute stretch
29 30 31 |
# File 'lib/plushie/type/font.rb', line 29 def stretch @stretch end |
#style ⇒ Object (readonly)
Returns the value of attribute style
29 30 31 |
# File 'lib/plushie/type/font.rb', line 29 def style @style end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight
29 30 31 |
# File 'lib/plushie/type/font.rb', line 29 def weight @weight end |
Instance Method Details
#with(**changes) ⇒ Object
Returns a copy with the given fields updated.
35 36 37 |
# File 'lib/plushie/type/font.rb', line 35 def with(**changes) self.class.new(**to_h.merge(changes)) end |