Sha256: e86daa72aca83b68808a8b73829978ce4051a5c806e7f3d130d53949e3cfd231
Contents?: true
Size: 1.04 KB
Versions: 50
Compression:
Stored size: 1.04 KB
Contents
module Shelly class Organization < Model attr_accessor :name, :app_code_names, :redeem_code def initialize(attributes = {}) @name = attributes["name"] @app_code_names = attributes["app_code_names"] end def apps app_code_names.map do |code_name| Shelly::App.new(code_name) end end def create attributes = {:name => name, :redeem_code => redeem_code} shelly.create_organization(attributes) end def memberships @members ||= Array(shelly.members(name)). sort_by { |c| c["email"] } end def owners memberships.select { |c| c["owner"] } - inactive_members end def members memberships.select { |c| !c["owner"] } - inactive_members end def inactive_members memberships.select { |c| !c["active"] } end def send_invitation(email, owner) shelly.send_invitation(name, email, owner) end def delete_member(email) shelly.delete_member(name, email) end def to_s name end end end
Version data entries
50 entries across 50 versions & 1 rubygems