Class: Hyrb::Models::Cache::Developers

Inherits:
Hyrb::Model show all
Defined in:
lib/hyrb/models/cache.rb

Instance Attribute Summary

Attributes inherited from Hyrb::Model

#data, #path

Instance Method Summary collapse

Methods inherited from Hyrb::Model

#filepath, #load_config_file, #reload!, #save!

Constructor Details

#initialize(data = nil) ⇒ Developers

Returns a new instance of Developers.



5
6
7
# File 'lib/hyrb/models/cache.rb', line 5

def initialize(data = nil)
  super(File.join("cache", "developers"), data)
end

Instance Method Details

#deserialize(data) ⇒ Object



13
14
15
# File 'lib/hyrb/models/cache.rb', line 13

def deserialize(data)
  data && data.map { |d| Developer.new(d) }
end

#serialize(data) ⇒ Object



9
10
11
# File 'lib/hyrb/models/cache.rb', line 9

def serialize(data)
  data.map(&:to_hash)
end