Class: FigmaComponentsStylesResult

Inherits:
Object
  • Object
show all
Defined in:
lib/admiral-tools-figma/helper/figma/figma_client/models/api/results/figma_components_styles_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error:, status:, meta:) ⇒ FigmaComponentsStylesResult

Returns a new instance of FigmaComponentsStylesResult.



8
9
10
11
12
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/results/figma_components_styles_result.rb', line 8

def initialize(error:, status:, meta:)
  @error = error
  @status = status
  @meta = meta
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



6
7
8
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/results/figma_components_styles_result.rb', line 6

def error
  @error
end

#metaObject

Returns the value of attribute meta.



6
7
8
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/results/figma_components_styles_result.rb', line 6

def meta
  @meta
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/results/figma_components_styles_result.rb', line 6

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/results/figma_components_styles_result.rb', line 14

def self.from_hash(hash)
  return nil if hash.nil?

  error = hash['error']
  status = hash['status']
  meta_hash = hash['meta']
  meta = meta_hash.nil? ? nil : FigmaComponentsStylesMeta.from_hash(meta_hash)

  if !error.nil? && !status.nil? && !meta.nil?
    return FigmaComponentsStylesResult.new(error: error, status: status, meta: meta)
  end

  nil
end

Instance Method Details

#to_hashObject



29
30
31
32
33
34
35
# File 'lib/admiral-tools-figma/helper/figma/figma_client/models/api/results/figma_components_styles_result.rb', line 29

def to_hash
  hash = {}
  hash['error'] = error
  hash['status'] = status
  hash['meta'] = meta.to_hash unless meta.nil?
  hash
end