jasper-vercnocke-thermostat-excercise 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/led.rb +9 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac0480bcbb85d8c7197410a4609a574895b8dae6
4
- data.tar.gz: 702c84c1ee2d49714a4416712108f04246034828
3
+ metadata.gz: 8a5a2954951f2f54abcbcd93e4b13cc964d5370a
4
+ data.tar.gz: d134d608602305e2052a2b72c680aa654b21bb6d
5
5
  SHA512:
6
- metadata.gz: 6198b189a17b0ef3945a150780cce16497f8e071f4b90765ac30f195d70dd8828fefb990930ad0e4734f2482b1ae38d038414c771fb12c04c975028d3ce5c696
7
- data.tar.gz: b4c812b5952b6198b9be12fcc6eabbfdc909d5615000d1d71aab4455c6b423acb92718ed712f0d9eefd058835a252febab407f46c7493c13e870c1bc2795c224
6
+ metadata.gz: 2ee87e79ffa4c9bfd7fcbc2b79f423f7bcf5887140b3b22010b2131498a80d504baacc87f865ce28227c29e47d2c9a765cd9bd46c849ebffb9856b3801bc5d2b
7
+ data.tar.gz: ee5204044974e145c0d846c48ffd0caa057447846af606a4b5a1fc78c5c295cff5800c0b13b901ff6baf8e9af85b34b811c68b1a0318193fa1d384b3e66b62fa
data/lib/led.rb CHANGED
@@ -1,9 +1,14 @@
1
+ # Led type with full RGB hexadecimals output
2
+ # The Led class accepts any value and transform it to an hexadecimals RGB output.
3
+ # @author Jasper Vercnocke <jasper.vercnocke@student.vives.be>
1
4
  class Led
2
5
  def initialize
3
6
  @color = "000000"
4
7
  @zero = "00"
5
8
  end
6
9
 
10
+ # @param value [Number] color in decimals
11
+ # Set color in RGB hexadecimals
7
12
  def set_color(value)
8
13
  if value < 0
9
14
  calc = value.abs.to_s(16).rjust(2,'0')
@@ -19,11 +24,13 @@ class Led
19
24
  @color = "00FF00"
20
25
  end
21
26
  end
22
-
27
+ # Return color in RGB hexadecimals in string format
28
+ # @return [String] RGB value in hexadecimals
23
29
  def string
24
30
  "The LED is #{@color}"
25
31
  end
26
-
32
+
33
+ # @return [Number] RGB value in hexadecimals
27
34
  def get_color
28
35
  @color
29
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasper-vercnocke-thermostat-excercise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jasper Vercnocke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-16 00:00:00.000000000 Z
11
+ date: 2017-05-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Excercise for education: Thermostat with mqtt & https'
14
14
  email: jasper.vercnocke@student.vives.be
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  version: '0'
48
48
  requirements: []
49
49
  rubyforge_project:
50
- rubygems_version: 2.5.2
50
+ rubygems_version: 2.6.12
51
51
  signing_key:
52
52
  specification_version: 4
53
53
  summary: Thermostat