Skip to content

Commit

Permalink
Merge pull request #16 from mjdevs/master
Browse files Browse the repository at this point in the history
Make JSON compute properties public
  • Loading branch information
mattdonnelly committed Jul 27, 2014
2 parents 4236964 + 2c08ef7 commit 45c1e62
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Swifter/JSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public enum JSON : Equatable, Printable {
}
}

var string : String? {
public var string : String? {
switch self {
case .JSONString(let value):
return value
Expand All @@ -162,7 +162,7 @@ public enum JSON : Equatable, Printable {
}
}

var integer : Int? {
public var integer : Int? {
switch self {
case .JSONNumber(let value):
return Int(value)
Expand All @@ -172,7 +172,7 @@ public enum JSON : Equatable, Printable {
}
}

var double : Double? {
public var double : Double? {
switch self {
case .JSONNumber(let value):
return value
Expand All @@ -182,7 +182,7 @@ public enum JSON : Equatable, Printable {
}
}

var object : Dictionary<String, JSONValue>? {
public var object : Dictionary<String, JSONValue>? {
switch self {
case .JSONObject(let value):
return value
Expand All @@ -192,7 +192,7 @@ public enum JSON : Equatable, Printable {
}
}

var array : Array<JSONValue>? {
public var array : Array<JSONValue>? {
switch self {
case .JSONArray(let value):
return value
Expand All @@ -202,7 +202,7 @@ public enum JSON : Equatable, Printable {
}
}

var bool : Bool? {
public var bool : Bool? {
switch self {
case .JSONBool(let value):
return value
Expand All @@ -212,7 +212,7 @@ public enum JSON : Equatable, Printable {
}
}

subscript(key: String) -> JSONValue {
public subscript(key: String) -> JSONValue {
switch self {
case .JSONObject(let dict):
if let value = dict[key] {
Expand All @@ -227,7 +227,7 @@ public enum JSON : Equatable, Printable {
}
}

subscript(index: Int) -> JSONValue {
public subscript(index: Int) -> JSONValue {
switch self {
case .JSONArray(let array) where array.count > index:
return array[index]
Expand Down

0 comments on commit 45c1e62

Please sign in to comment.