Class: Planvine::CategoriesBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/planvine/builders/categories_builder.rb

Class Method Summary collapse

Class Method Details

.build(category, api) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/planvine/builders/categories_builder.rb', line 3

def self.build(category, api)
  Category.new(
    :photo => (category["photo"] ? category["photo"]["url"] : ''),
    :slug => category["slug"],
    :name => category["name"],
    :id => category["id"],
    :api => api
  )
end