Module: DungeonMaster::Helpers

Defined in:
lib/dungeon_master.rb

Instance Method Summary collapse

Instance Method Details

#dungeon_masterObject



45
46
47
48
# File 'lib/dungeon_master.rb', line 45

def dungeon_master
  $dm ||
  raise("Override this method to return your instance of DungeonMaster::Decider")
end

#dungeon_master_jsonObject



37
38
39
40
41
42
43
# File 'lib/dungeon_master.rb', line 37

def dungeon_master_json
  memberships = Hash[*dungeon_master.groups.map do |group|
    [group, dungeon_master.active?(request.env["HTTP_USER_AGENT"])]
  end.flatten]

  Yajl::Encoder.encode(memberships)
end