parseRule method

bool parseRule (Map<String, dynamic> lib)

Implementation

bool parseRule(Map<String,dynamic> lib) {
  if(lib["rules"] != null) {
    if (lib["rules"].length > 1) {
      if (lib["rules"][0]["action"] == 'allow' && lib["rules"][1]["action"] == 'disallow' && lib["rules"][1]["os"]["name"] == 'osx') {
        return this.getOS() == 'osx';
      } else {
        return true;
      }
    } else {
      if (lib["rules"][0]["action"] == 'allow' && lib["rules"][0]["os"] != null) return this.getOS() != 'osx';
    }
  }
  return false;
}