edfize 0.1.0.beta7 → 0.1.0.beta8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba1a8b5aedfca32378aa7f2a33e74e905f55de59
4
- data.tar.gz: 31c306bb6cc1eae5ff5e648825efc0fce4313d9e
3
+ metadata.gz: dea20df7bcf2794b479e5ad5265a88ccb7e9bcca
4
+ data.tar.gz: 08d7115da77547f4363d16c345932713ffd95eb8
5
5
  SHA512:
6
- metadata.gz: 5d9796b9ab7062d8852cd69e78fbdd575d101836cdba1b4d63bd3af4a1b6a9502a3bb52ce8c87e8fa2bd0312a9586b3b17bfc64f8f366ed55ee96a422e277424
7
- data.tar.gz: 806d2e78b1d4f0173a900e09618c290213b70f3bb2fbfc0d75b344dc1985de9a2f4cc7f6c0ba1bc65ce1d371088b863a24809df4dd9729bb0751f54ba3f49c7a
6
+ metadata.gz: 22e2281613deed44e59b4ca6f7c489165583561b340420794ea79376def894bcf423a0d4f4ad1605182355cb707c418168a5897efa45a3101e2c55a388c6a390
7
+ data.tar.gz: 95394c3fc72cee59a507325539d96a2a3caef54d21a3140015e8b858f68778154c4659df787dc97f4b4284a069d492aaf6af80b9eb6a36c45ca7a8c0a08328e4
data/lib/edfize/edf.rb CHANGED
@@ -6,16 +6,16 @@ module Edfize
6
6
  attr_reader :filename
7
7
 
8
8
  # Header Information
9
- attr_reader :version
10
- attr_reader :local_patient_identification
11
- attr_reader :local_recording_identification
12
- attr_reader :start_date_of_recording
13
- attr_reader :start_time_of_recording
14
- attr_reader :number_of_bytes_in_header
15
- attr_reader :reserved
16
- attr_reader :number_of_data_records
17
- attr_reader :duration_of_a_data_record
18
- attr_reader :number_of_signals
9
+ attr_accessor :version
10
+ attr_accessor :local_patient_identification
11
+ attr_accessor :local_recording_identification
12
+ attr_accessor :start_date_of_recording
13
+ attr_accessor :start_time_of_recording
14
+ attr_accessor :number_of_bytes_in_header
15
+ attr_accessor :reserved
16
+ attr_accessor :number_of_data_records
17
+ attr_accessor :duration_of_a_data_record
18
+ attr_accessor :number_of_signals
19
19
 
20
20
  attr_accessor :signals
21
21
 
@@ -39,12 +39,19 @@ module Edfize
39
39
  # Used by tests
40
40
  RESERVED_SIZE = HEADER_CONFIG[:reserved][:size]
41
41
 
42
+ def self.create(filename, &block)
43
+ edf = self.new(filename)
44
+ yield edf if block_given?
45
+ edf
46
+ end
47
+
42
48
  def initialize(filename)
43
49
  @filename = filename
44
50
  @signals = []
45
51
 
46
52
  read_header
47
53
  read_signal_header
54
+ self
48
55
  end
49
56
 
50
57
  def load_signals
data/lib/edfize/signal.rb CHANGED
@@ -22,6 +22,13 @@ module Edfize
22
22
  def initialize
23
23
  @digital_values = []
24
24
  @physical_values = []
25
+ self
26
+ end
27
+
28
+ def self.create(&block)
29
+ signal = self.new
30
+ yield signal if block_given?
31
+ signal
25
32
  end
26
33
 
27
34
  def print_header
@@ -3,7 +3,7 @@ module Edfize
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
5
  TINY = 0
6
- BUILD = "beta7"
6
+ BUILD = "beta8"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edfize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta7
4
+ version: 0.1.0.beta8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Remo Mueller