Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Match the syntax style in AST.scala to the rest of the library #37

Merged
merged 1 commit into from

2 participants

@tnm

It's a Moonism.

@codahale codahale merged commit 39d4c0c into codahale:development
@codahale
Owner

Dat Moon.

@theatrus theatrus referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/main/scala/com/codahale/jerkson/AST.scala
View
16 src/main/scala/com/codahale/jerkson/AST.scala
@@ -2,15 +2,15 @@ package com.codahale.jerkson
object AST {
sealed trait JValue {
- def value : Any
+ def value: Any
- def valueAs[A] : A = value.asInstanceOf[A]
+ def valueAs[A]: A = value.asInstanceOf[A]
- def \(fieldName : String) : JValue = JNull
+ def \(fieldName: String): JValue = JNull
- def apply(idx : Int) : JValue = JNull
+ def apply(idx: Int): JValue = JNull
- def \\(fieldName : String) : Seq[JValue] = Nil
+ def \\(fieldName: String): Seq[JValue] = Nil
}
case object JNull extends JValue {
@@ -28,7 +28,7 @@ object AST {
case class JArray(elements: List[JValue]) extends JValue {
def value = null
- override def apply(index : Int) : JValue = {
+ override def apply(index: Int): JValue = {
try {
elements(index)
} catch {
@@ -42,7 +42,7 @@ object AST {
case class JObject(fields: List[JField]) extends JValue {
def value = null
- override def \(fieldName : String) : JValue = {
+ override def \(fieldName: String): JValue = {
fields.find { case JField(name, _) =>
name == fieldName
}.map { case JField(_, value) =>
@@ -50,7 +50,7 @@ object AST {
}.getOrElse(JNull)
}
- override def \\(fieldName : String) : Seq[JValue] = {
+ override def \\(fieldName: String): Seq[JValue] = {
fields.flatMap {
case JField(name, value) if name == fieldName => Seq(value) ++ (value \\ fieldName)
case JField(_, value) => value \\ fieldName
Something went wrong with that request. Please try again.