Skip to content

Instantly share code, notes, and snippets.

@jaturken
Created February 16, 2016 11:09
Show Gist options
  • Save jaturken/3a8ed5d6cb789796d669 to your computer and use it in GitHub Desktop.
Save jaturken/3a8ed5d6cb789796d669 to your computer and use it in GitHub Desktop.
class BaseReport
def not_implemented *args
fail "Not implemented. Implement in your report class"
end
alias_method :load_db_data, :not_implemented
alias_method :load_parsed_data, :not_implemented
alias_method :validate_data, :not_implemented
alias_method :reparse_data, :not_implemented
alias_method :build_report, :not_implemented
alias_method :build_statistic, :not_implemented
def iterate_over_shop(shop_folder, category_id = nil, &block)
# TODO: iterate over shop sitemap
# TODO: possibly parse products from category(as customer or competitor)
end
def parse_product(shop_folder, id, &block)
# TODO: find product in shop(by id, sku, url etc) and apply block to it
end
def send_email(to, subject, body, attach)
# TODO: implement sending email
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment