File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ class DublinCore {
6
6
final String description;
7
7
final String creator;
8
8
final String subject;
9
+ final List <String > subjects;
9
10
final String publisher;
10
11
final String contributor;
11
12
final String date;
@@ -23,6 +24,7 @@ class DublinCore {
23
24
this .description,
24
25
this .creator,
25
26
this .subject,
27
+ this .subjects,
26
28
this .publisher,
27
29
this .contributor,
28
30
this .date,
@@ -45,6 +47,9 @@ class DublinCore {
45
47
description: findElementOrNull (element, "dc:description" )? .text,
46
48
creator: findElementOrNull (element, "dc:creator" )? .text,
47
49
subject: findElementOrNull (element, "dc:subject" )? .text,
50
+ subjects: findAllDirectElementsOrNull (element, 'dc:subject' )
51
+ .map ((subjectElement) => subjectElement.text)
52
+ .toList (),
48
53
publisher: findElementOrNull (element, "dc:publisher" )? .text,
49
54
contributor: findElementOrNull (element, "dc:contributor" )? .text,
50
55
date: findElementOrNull (element, "dc:date" )? .text,
Original file line number Diff line number Diff line change @@ -110,5 +110,9 @@ void main() {
110
110
expect (firstItem.link, 'http://b.hatena.ne.jp/guide/staff_bookmark_03' );
111
111
expect (firstItem.dc.creator, 'sample' );
112
112
expect (firstItem.dc.date, '2009-04-10T09:44:20Z' );
113
+ expect (firstItem.dc.subject, 'はてな' );
114
+ expect (firstItem.dc.subjects[0 ], 'はてな' );
115
+ expect (firstItem.dc.subjects[1 ], 'インタビュー' );
116
+ expect (firstItem.dc.subjects[2 ], 'はてなブックマーク' );
113
117
});
114
118
}
You can’t perform that action at this time.
0 commit comments