Module: ChefFixie::UtilityHelpers
- Defined in:
- lib/chef_fixie/utility_helpers.rb
Class Method Summary collapse
- .assocs ⇒ Object
- .invites ⇒ Object
- .make_org(org) ⇒ Object
- .make_user(user) ⇒ Object
- .orgs ⇒ Object
- .users ⇒ Object
Class Method Details
.assocs ⇒ Object
33 34 35 |
# File 'lib/chef_fixie/utility_helpers.rb', line 33 def self.assocs @assocs ||= ChefFixie::Sql::Associations.new end |
.invites ⇒ Object
36 37 38 |
# File 'lib/chef_fixie/utility_helpers.rb', line 36 def self.invites invites ||= ChefFixie::Sql::Invites.new end |
.make_org(org) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/chef_fixie/utility_helpers.rb', line 49 def self.make_org(org) if org.is_a?(String) return orgs[org] elsif org.is_a?(ChefFixie::Sql::Org) return org else raise Exception "Expected an org, got a #{org.class}" end end |
.make_user(user) ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/chef_fixie/utility_helpers.rb', line 40 def self.make_user(user) if user.is_a?(String) return users[user] elsif user.is_a?(ChefFixie::Sql::User) return user else raise Exception "Expected a user, got a #{user.class}" end end |