Class: Font
- Inherits:
-
Object
- Object
- Font
- Defined in:
- lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb
Instance Attribute Summary collapse
-
#font_family ⇒ Object
Returns the value of attribute font_family.
-
#font_postscript_name ⇒ Object
Returns the value of attribute font_postscript_name.
-
#font_size ⇒ Object
Returns the value of attribute font_size.
-
#font_weight ⇒ Object
Returns the value of attribute font_weight.
-
#letter_spacing ⇒ Object
Returns the value of attribute letter_spacing.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(font_family:, font_postscript_name:, font_size:, font_weight:, letter_spacing:) ⇒ Font
constructor
A new instance of Font.
- #to_hash ⇒ Object
Constructor Details
#initialize(font_family:, font_postscript_name:, font_size:, font_weight:, letter_spacing:) ⇒ Font
Returns a new instance of Font.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 11 def initialize( font_family:, font_postscript_name:, font_size:, font_weight:, letter_spacing: ) @font_family = font_family @font_postscript_name = font_postscript_name @font_size = font_size @font_weight = font_weight @letter_spacing = letter_spacing end |
Instance Attribute Details
#font_family ⇒ Object
Returns the value of attribute font_family.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 4 def font_family @font_family end |
#font_postscript_name ⇒ Object
Returns the value of attribute font_postscript_name.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 4 def font_postscript_name @font_postscript_name end |
#font_size ⇒ Object
Returns the value of attribute font_size.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 4 def font_size @font_size end |
#font_weight ⇒ Object
Returns the value of attribute font_weight.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 4 def font_weight @font_weight end |
#letter_spacing ⇒ Object
Returns the value of attribute letter_spacing.
4 5 6 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 4 def letter_spacing @letter_spacing end |
Class Method Details
.from_hash(hash) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 25 def self.from_hash(hash) return nil if hash.nil? font_family = hash['font_family'] font_postscript_name = hash['font_postscript_name'] font_size = hash['font_size'] font_weight = hash['font_weight'] letter_spacing = hash['letter_spacing'] if !font_family.nil? && !font_postscript_name.nil? && !font_size.nil? && !font_weight.nil? && !letter_spacing.nil? return Font.new( font_family: font_family, font_postscript_name: font_postscript_name, font_size: font_size, font_weight: font_weight, letter_spacing: letter_spacing ) end nil end |
Instance Method Details
#to_hash ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/font.rb', line 47 def to_hash hash = {} hash['font_family'] = font_family hash['font_postscript_name'] = font_postscript_name hash['font_size'] = font_size hash['font_weight'] = font_weight hash['letter_spacing'] = letter_spacing hash end |