Class: Pictify::ListTemplatesResult

Inherits:
Object
  • Object
show all
Defined in:
lib/pictify/types.rb

Overview

Result of listing templates (list_templates).

Maps { templates: […], pagination: {…} }.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ListTemplatesResult

Returns a new instance of ListTemplatesResult.



250
251
252
253
254
# File 'lib/pictify/types.rb', line 250

def initialize(data)
  @raw = data
  @templates = (data["templates"] || []).map { |t| Template.new(t) }
  @pagination = data["pagination"] ? Pagination.new(data["pagination"]) : nil
end

Instance Attribute Details

#paginationObject (readonly)

Returns the value of attribute pagination.



248
249
250
# File 'lib/pictify/types.rb', line 248

def pagination
  @pagination
end

#rawObject (readonly)

Returns the value of attribute raw.



248
249
250
# File 'lib/pictify/types.rb', line 248

def raw
  @raw
end

#templatesObject (readonly)

Returns the value of attribute templates.



248
249
250
# File 'lib/pictify/types.rb', line 248

def templates
  @templates
end