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.



256
257
258
259
260
# File 'lib/pictify/types.rb', line 256

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.



254
255
256
# File 'lib/pictify/types.rb', line 254

def pagination
  @pagination
end

#rawObject (readonly)

Returns the value of attribute raw.



254
255
256
# File 'lib/pictify/types.rb', line 254

def raw
  @raw
end

#templatesObject (readonly)

Returns the value of attribute templates.



254
255
256
# File 'lib/pictify/types.rb', line 254

def templates
  @templates
end