Skip to content

Commit

Permalink
Download available plans for a site.
Browse files Browse the repository at this point in the history
Refactoring!!
  • Loading branch information
daniloercoli committed Feb 3, 2016
1 parent 0c37b48 commit ab0599a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ public static boolean getBool(JSONObject json, String name) {
return true;
}

public static boolean isStringTrue(JSONObject json, String name) {
String rawAvailable = json.optString(name).toLowerCase();
return "yes".equals(rawAvailable) || "1".equals(rawAvailable) || "true".equals(rawAvailable);
}

/*
* returns the JSONObject child of the passed parent that matches the passed query
* this is basically an "optJSONObject" that supports nested queries, for example:
Expand Down

0 comments on commit ab0599a

Please sign in to comment.