class Plangrade::Resources::Notice

Public Class Methods

all(company_id) click to toggle source
# File lib/plangrade/resources/notice.rb, line 7
def self.all(company_id)
  result = api_handler.all_notices(company_id)
  parsed_result = JSON.parse(result.body)
  notices ||= begin
    parsed_result.map do |notice|
      new(:id => notice["id"], :name => notice["name"], :plan_name => notice["plan_name"], :link => notice["link"], :created_at => notice["created_at"])
    end
  end
  notices
end