class Gallerist::BaseModel

This code is free software; you can redistribute it and/or modify it under the terms of the new BSD License.

Copyright © 2015, Sebastian Staudt

Public Class Methods

iphoto(&block) click to toggle source
# File lib/gallerist/models/base_model.rb, line 12
def self.iphoto(&block)
  store_setup :iphoto, &block
end
photos(&block) click to toggle source
# File lib/gallerist/models/base_model.rb, line 16
def self.photos(&block)
  store_setup :photos, &block
end
setup_for(app) click to toggle source
# File lib/gallerist/models/base_model.rb, line 20
def self.setup_for(app)
  ((@setups || {})[app] || []).each do |setup|
    setup.call
  end
end
store_setup(app, &block) click to toggle source
# File lib/gallerist/models/base_model.rb, line 26
def self.store_setup(app, &block)
  @setups ||= {}
  @setups[app] ||= []
  @setups[app] << block
end