Sha256: 137bc3f75d3475a3769ba4f3e671abbe2865026e32768c775752623692f0c267
Contents?: true
Size: 584 Bytes
Versions: 13
Compression:
Stored size: 584 Bytes
Contents
require 'plaid/util' module Plaid class Category include Plaid::Util attr_accessor(:type, :hierarchy, :id, :cat_array) def instantiate_all_categories(res) self.cat_array = [] res.each do |cat| category = Category.new self.cat_array << category.build_category(cat) end self.cat_array end def instantiate_one_category(res) self.build_category(res) self end protected def build_category(cat) self.type = cat['type'], self.hierarchy = cat['hierarchy'], self.id = cat['id'] end end end
Version data entries
13 entries across 13 versions & 1 rubygems