Class: ComponentsList
- Inherits:
-
Object
- Object
- ComponentsList
- Defined in:
- lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/components_list.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(components:) ⇒ ComponentsList
constructor
A new instance of ComponentsList.
- #to_hash ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(components:) ⇒ ComponentsList
Returns a new instance of ComponentsList.
9 10 11 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/components_list.rb', line 9 def initialize(components:) @components = components end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
7 8 9 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/components_list.rb', line 7 def components @components end |
Class Method Details
.from_hash(hash) ⇒ Object
13 14 15 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/components_list.rb', line 13 def self.from_hash(hash) hash.map { |s| Component.from_hash(s) } end |
.from_json(json) ⇒ Object
21 22 23 24 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/components_list.rb', line 21 def self.from_json(json) components = (JSON.parse(json) || []).map { |s| Component.from_hash(s) } ComponentsList.new(components: components) end |
Instance Method Details
#to_hash ⇒ Object
17 18 19 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/components_list.rb', line 17 def to_hash components.map(&:to_hash) end |
#to_json(*_args) ⇒ Object
26 27 28 |
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/domain/primitives/components_list.rb', line 26 def to_json(*_args) components.map(&:to_hash).to_json end |