Class: TRMNL::API::Models::Recipes::Data
- Inherits:
-
Struct
- Object
- Struct
- TRMNL::API::Models::Recipes::Data
- Defined in:
- lib/trmnl/api/models/recipes/data.rb
Overview
Models the data of the API response.
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
-
#icon_content_type ⇒ Object
Returns the value of attribute icon_content_type.
-
#icon_url ⇒ Object
Returns the value of attribute icon_url.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#published_at ⇒ Object
Returns the value of attribute published_at.
-
#screenshot_url ⇒ Object
Returns the value of attribute screenshot_url.
-
#statistics ⇒ Object
Returns the value of attribute statistics.
Class Method Summary collapse
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def @author end |
#custom_fields ⇒ Object
Returns the value of attribute custom_fields
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def custom_fields @custom_fields end |
#icon_content_type ⇒ Object
Returns the value of attribute icon_content_type
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def icon_content_type @icon_content_type end |
#icon_url ⇒ Object
Returns the value of attribute icon_url
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def icon_url @icon_url end |
#id ⇒ Object
Returns the value of attribute id
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def id @id end |
#name ⇒ Object
Returns the value of attribute name
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def name @name end |
#published_at ⇒ Object
Returns the value of attribute published_at
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def published_at @published_at end |
#screenshot_url ⇒ Object
Returns the value of attribute screenshot_url
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def screenshot_url @screenshot_url end |
#statistics ⇒ Object
Returns the value of attribute statistics
8 9 10 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 8 def statistics @statistics end |
Class Method Details
.for(**attributes) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/trmnl/api/models/recipes/data.rb', line 19 def self.for(**attributes) new( **attributes.merge!( author: Author.for(**attributes.delete(:author_bio)), statistics: Statistics[**attributes.delete(:stats)] ) ) end |