efo_nelfo 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/efo_nelfo/v40/vl.rb +4 -0
- data/lib/efo_nelfo/v40/vx.rb +9 -0
- data/lib/efo_nelfo/version.rb +1 -1
- data/spec/vl_spec.rb +21 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f389f65b4a9eb9dd8dc8c08c7a35d503681d80c
|
4
|
+
data.tar.gz: 49a45cedbc30524de77097fdcd8e404417358333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f976078206c2b97b86a93919996ba2ba1986120b0ed844833dda3b326947bbef7fd73315f5fd94c2c775160dac8e7f3fc46e7e41bd01980d4e3fa5b5b6351b28
|
7
|
+
data.tar.gz: e0fecdcd62acf5815e5c6271977948857059fda3bfdcacdc58df828842d2cc2ddc04070bba59f3339ec64bbb6d5dca1e090cf261202325edf15a4b4537ce72af
|
data/lib/efo_nelfo/v40/vl.rb
CHANGED
data/lib/efo_nelfo/v40/vx.rb
CHANGED
@@ -4,6 +4,15 @@ module EfoNelfo
|
|
4
4
|
property :post_type, alias: :PostType, limit: 2, default: post_type
|
5
5
|
property :field, alias: :FeltId, limit: 10, required: true
|
6
6
|
property :value, alias: :Verdi, limit: 70, required: true
|
7
|
+
|
8
|
+
def image?
|
9
|
+
field == 'BILDE'
|
10
|
+
end
|
11
|
+
|
12
|
+
def image
|
13
|
+
value if image?
|
14
|
+
end
|
15
|
+
|
7
16
|
end
|
8
17
|
end
|
9
18
|
end
|
data/lib/efo_nelfo/version.rb
CHANGED
data/spec/vl_spec.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe EfoNelfo::V40::VL do
|
4
|
+
|
5
|
+
let(:vl) { EfoNelfo::V40::VL.new }
|
6
|
+
|
7
|
+
describe "#images" do
|
8
|
+
it "returns nil when there are no images available" do
|
9
|
+
vl.images.must_be_empty
|
10
|
+
end
|
11
|
+
|
12
|
+
it "returns array of urls when images are present" do
|
13
|
+
vl.info << { field: 'BILDE', value: 'http://foo/bar.png' }
|
14
|
+
vl.info << { field: 'BILDE', value: 'http://foo/bar.gif' }
|
15
|
+
vl.info << { field: 'VEKT', value: '2kg' }
|
16
|
+
vl.images.must_equal ['http://foo/bar.png', 'http://foo/bar.gif']
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: efo_nelfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gudleik Rasch
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- spec/samples/varefil_eksempel.csv
|
159
159
|
- spec/samples/varer_small.csv
|
160
160
|
- spec/spec_helper.rb
|
161
|
+
- spec/vl_spec.rb
|
161
162
|
homepage: http://efo.no
|
162
163
|
licenses:
|
163
164
|
- MIT
|
@@ -201,3 +202,4 @@ test_files:
|
|
201
202
|
- spec/samples/varefil_eksempel.csv
|
202
203
|
- spec/samples/varer_small.csv
|
203
204
|
- spec/spec_helper.rb
|
205
|
+
- spec/vl_spec.rb
|