Sha256: 25d05d8e813c854d86b60a634a50e406a1f3ad446da090fe074796f906b59781
Contents?: true
Size: 511 Bytes
Versions: 9
Compression:
Stored size: 511 Bytes
Contents
require "amaranth/request" module Amaranth class Team < Struct.new(:name, :slug) def self.find_by_slug slug if attributes = Request.get("/api/teams/#{slug}/") new attributes.keep_if { |key, value| members.include? key.to_sym } end end def initialize attributes={} attributes.each do |key, value| self[key] = value end end def projects Project.all(team_slug: slug) end def videos Video.all(team_slug: slug) end end end
Version data entries
9 entries across 9 versions & 1 rubygems