Skip to content

Commit

Permalink
Use val where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
cquiroz committed Jun 28, 2017
1 parent 17a1f16 commit e3f5d67
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions shared/src/main/scala/squants/electro/Permeability.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@ import squants.motion.Newtons
* @author cquiroz
* @since 1.4
*
* @param value value in [[squants.electro.Webers]]
* @param value value in [[squants.electro.HenriesPerMeter]]
*/
final class Permeability private (val value: Double, val unit: PermeabilityUnit)
extends Quantity[Permeability] {

def dimension = Permeability
val dimension = Permeability

def toHenriesPerMeter = to(HenriesPerMeter)
def toNewtonsPerAmpereSquared = to(NewtonsPerAmperesSquared)
}

object Permeability extends Dimension[Permeability] {
private[electro] def apply[A](n: A, unit: PermeabilityUnit)(implicit num: Numeric[A]) = new Permeability(num.toDouble(n), unit)
def apply = parse _
def name = "Permeability"
def primaryUnit = HenriesPerMeter
def siUnit = HenriesPerMeter
def units = Set(HenriesPerMeter, NewtonsPerAmperesSquared)
val apply = parse _
val name = "Permeability"
val primaryUnit = HenriesPerMeter
val siUnit = HenriesPerMeter
val units = Set[UnitOfMeasure[Permeability]](HenriesPerMeter, NewtonsPerAmperesSquared)
}

trait PermeabilityUnit extends UnitOfMeasure[Permeability] with UnitConverter {
def apply[A](n: A)(implicit num: Numeric[A]) = Permeability(n, this)
}

object HenriesPerMeter extends PermeabilityUnit with PrimaryUnit with SiUnit {
def symbol = s"${Henry.symbol}/${Meters.symbol}"
val symbol = s"${Henry.symbol}/${Meters.symbol}"
}

object NewtonsPerAmperesSquared extends PermeabilityUnit with PrimaryUnit with SiUnit {
def symbol = s"${Newtons.symbol}/${Amperes.symbol}²"
val symbol = s"${Newtons.symbol}/${Amperes.symbol}²"
}

object PermeabilityConversions {
Expand Down

0 comments on commit e3f5d67

Please sign in to comment.