strom 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d61b39f0744381d320e9f4f2235f91dbca055e5
4
- data.tar.gz: db87b24c86db4c2ea37db6f97dba486607021046
3
+ metadata.gz: 524d248b1b045c4075ae122ad582f31386ce30c1
4
+ data.tar.gz: 0dc689415b729d709a712b3ed210e9334ab40bfa
5
5
  SHA512:
6
- metadata.gz: 2f49bc2307e4e68c5f9936b44ce3f22f727d644ad9a42903922b5450701b5b35e0059cdc392959dedff2b065c577593df86f9588b175fd27aa7431866158c789
7
- data.tar.gz: 0837348cb5a3f04df5d616a6f6d836f697592b37ea297bb6f0086c93b5449c24f00fbf6ad5dd456655133608f0c30e2f2e05ff551e66057561fec39f676b5953
6
+ metadata.gz: 0b805f78884be91b673fca06547611d6dad9164b6dec299329a3a19675550b01e6582ffa60182bb7efc6747ba24c5076f2db03c2aed9e6c59f5d2c7cb70ddb73
7
+ data.tar.gz: de2fadc418fc72b128f0d933c4d113828b15ba84d6ca98609767eb2193f44717cc29c892fa84bf527e0ffa9aa9372eff60b24c61012389db237c156e9531af3d
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Gem Version](https://badge.fury.io/rb/strom.svg)](http://badge.fury.io/rb/strom)
1
2
  [![Build Status](https://travis-ci.org/kodnin/strom.svg?branch=master)](https://travis-ci.org/kodnin/strom)
2
3
 
3
4
  # Strom
@@ -1,4 +1,12 @@
1
1
  class Variable < Struct.new(:value)
2
+ def to_s
3
+ "#{value} #{self.class.to_s.downcase}s"
4
+ end
5
+
6
+ def inspect
7
+ to_s
8
+ end
9
+
2
10
  def and(other)
3
11
  current = resistance = voltage = nil
4
12
 
@@ -1,3 +1,3 @@
1
1
  module Strom
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -12,6 +12,14 @@ describe Variable do
12
12
  @variable.value.must_equal 1.0
13
13
  end
14
14
 
15
+ it '#to_s' do
16
+ @variable.to_s.must_equal '1.0 variables'
17
+ end
18
+
19
+ it '#inspect' do
20
+ @variable.inspect.must_equal '1.0 variables'
21
+ end
22
+
15
23
  it '#and' do
16
24
  0.5.amperes.and(18.ohms).must_equal Volt.new(9.0)
17
25
  18.ohms.and(9.volts).must_equal Ampere.new(0.5)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Boot