Class: Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/refworks/reference.rb

Overview

noinspection RubyTooManyInstanceVariablesInspection,RubyTooManyMethodsInspection

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rawref) ⇒ Reference

expecting a HTTParty-parsed RWResult reference hash to be passed in



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/refworks/reference.rb', line 17

def initialize(rawref)

  # Basically, creating an empty ref.  For instance, if you want to
  # hand-construct the reference one field at a time.
  unless rawref["rt"]
    return
  end

  # using Mash so I can use symbols as keys instead of strings, which is what
  # is returned from httparty
  ref = Mash.new(rawref)

  # Here I populate attributes which correspond to RefWorks Tagged Format.
  # See: http://www.refworks.com/rwathens/help/RefWorks_Tagged_Format.htm
  # for more details.  The tag list is in a comment at the end of this file.

  @rt = ref[:rt]

  # the next two are my own extensions, not part of the RefWorks tagged format.
  # They are a decomposition of the rt complex value which I think is useful.
  @rt_num = ref[:rt][:typeOrd]
  @rt_string = ref[:rt][:__content__]

  @sr = ref[:sr]

  @id = ref[:id][0]

  # HTTParty will produce either a string or an array when it converts the XML response
  # to a Ruby data structure.  Which one it produces depends upon how
  # many authors there are.  All values are converted to Arrays, even one item
  # values, for consistency.  I do this for any field which can have more than one value.
  # To accomplish this, I use the "friendly name" setters (e.g. self.authors) so that I don't
  # have to override the auto-generated setters that are created via attr_accessor.  This affects
  # the a1-a6 fields plus the k1 field.
  @a1 = self.a1=(ref[:a1])

  @t1 = ref[:t1]

  @jf = ref[:jf]
  @jo = ref[:jo]
  @yr = ref[:yr]
  @fd = ref[:fd]
  @vo = ref[:vo]
  @is = ref[:is]
  @sp = ref[:sp]
  @op = ref[:op]

  if ref[:k1]
    self.k1=(ref[:k1])
  end

  @ab = ref[:ab]
  @no = ref[:no]

  if ref[:a2]
    self.a2=(ref[:a2])
  end

  @t2 = ref[:t2]

  @ed = ref[:ed]
  @pb = ref[:pb]
  @pp = ref[:pp]

  if ref[:a3]
    self.a3=(ref[:a3])
  end

  if ref[:a4]
    self.a4=(ref[:a4])
  end

  if ref[:a5]
    self.a5=(ref[:a5])
  end

  @t3 = ref[:t3]
  @sn = ref[:sn]
  @av = ref[:av]
  @ad = ref[:ad]
  @an = ref[:an]
  @la = ref[:la]
  @cl = ref[:cl]
  @sf = ref[:sf]
  @ot = ref[:ot]
  @lk = ref[:lk]
  @do = ref[:do]
  @cn = ref[:cn]
  @db = ref[:db]
  @ds = ref[:ds]
  @ip = ref[:ip]
  @rd = ref[:rd]
  @st = ref[:st]
  @u1 = ref[:u1]
  @u2 = ref[:u2]
  @u3 = ref[:u3]
  @u4 = ref[:u4]
  @u5 = ref[:u5]
  @u6 = ref[:u6]
  @u7 = ref[:u7]
  @u8 = ref[:u8]
  @u9 = ref[:u9]
  @u10 = ref[:u10]
  @u11 = ref[:u11]
  @u12 = ref[:u12]
  @u13 = ref[:u13]
  @u14 = ref[:u14]
  @u15 = ref[:u15]
  @ul = ref[:ul]
  @sl = ref[:sl]
  @ll = ref[:ll]
  @cr = ref[:cr]
  @wt = ref[:wt]

  if ref[:a6]
    self.a6=(ref[:a6])
  end

  @wv = ref[:wv]
  @wp = ref[:wp]
  @ol = ref[:ol]
  @pmid = ref[:pmid]
  @pmcid = ref[:pmcid]

  # Not documented as part of the RefWorks tagged format, but the API returns these fields
  @fl = ref[:fl]
  @cd = ref[:cd]
  @md = ref[:md]
end

Instance Attribute Details

#a1Object

the following need special setter behavior (custom setters below) so they only get standard readers



14
15
16
# File 'lib/refworks/reference.rb', line 14

def a1
  @a1
end

#a2Object

the following need special setter behavior (custom setters below) so they only get standard readers



14
15
16
# File 'lib/refworks/reference.rb', line 14

def a2
  @a2
end

#a3Object

the following need special setter behavior (custom setters below) so they only get standard readers



14
15
16
# File 'lib/refworks/reference.rb', line 14

def a3
  @a3
end

#a4Object

the following need special setter behavior (custom setters below) so they only get standard readers



14
15
16
# File 'lib/refworks/reference.rb', line 14

def a4
  @a4
end

#a5Object

the following need special setter behavior (custom setters below) so they only get standard readers



14
15
16
# File 'lib/refworks/reference.rb', line 14

def a5
  @a5
end

#a6Object

the following need special setter behavior (custom setters below) so they only get standard readers



14
15
16
# File 'lib/refworks/reference.rb', line 14

def a6
  @a6
end

#abObject

Returns the value of attribute ab.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ab
  @ab
end

#adObject

Returns the value of attribute ad.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ad
  @ad
end

#anObject

Returns the value of attribute an.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def an
  @an
end

#avObject

Returns the value of attribute av.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def av
  @av
end

#cdObject

Returns the value of attribute cd.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def cd
  @cd
end

#clObject

Returns the value of attribute cl.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def cl
  @cl
end

#cnObject

Returns the value of attribute cn.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def cn
  @cn
end

#crObject

Returns the value of attribute cr.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def cr
  @cr
end

#dbObject

Returns the value of attribute db.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def db
  @db
end

#doObject

Returns the value of attribute do.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def do
  @do
end

#dsObject

Returns the value of attribute ds.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ds
  @ds
end

#edObject

Returns the value of attribute ed.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ed
  @ed
end

#fdObject

Returns the value of attribute fd.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def fd
  @fd
end

#flObject

Returns the value of attribute fl.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def fl
  @fl
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def id
  @id
end

#ipObject

Returns the value of attribute ip.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ip
  @ip
end

#isObject

Returns the value of attribute is.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def is
  @is
end

#jfObject

Returns the value of attribute jf.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def jf
  @jf
end

#joObject

Returns the value of attribute jo.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def jo
  @jo
end

#k1Object

the following need special setter behavior (custom setters below) so they only get standard readers



14
15
16
# File 'lib/refworks/reference.rb', line 14

def k1
  @k1
end

#laObject

Returns the value of attribute la.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def la
  @la
end

#lkObject

Returns the value of attribute lk.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def lk
  @lk
end

#llObject

Returns the value of attribute ll.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ll
  @ll
end

#mdObject

Returns the value of attribute md.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def md
  @md
end

#noObject

Returns the value of attribute no.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def no
  @no
end

#olObject

Returns the value of attribute ol.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ol
  @ol
end

#opObject

Returns the value of attribute op.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def op
  @op
end

#otObject

Returns the value of attribute ot.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ot
  @ot
end

#pbObject

Returns the value of attribute pb.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def pb
  @pb
end

#pmcidObject

Returns the value of attribute pmcid.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def pmcid
  @pmcid
end

#pmidObject

Returns the value of attribute pmid.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def pmid
  @pmid
end

#ppObject

Returns the value of attribute pp.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def pp
  @pp
end

#rdObject

Returns the value of attribute rd.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def rd
  @rd
end

#rtObject

Returns the value of attribute rt.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def rt
  @rt
end

#rt_numObject

Returns the value of attribute rt_num.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def rt_num
  @rt_num
end

#rt_stringObject

Returns the value of attribute rt_string.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def rt_string
  @rt_string
end

#sfObject

Returns the value of attribute sf.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def sf
  @sf
end

#slObject

Returns the value of attribute sl.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def sl
  @sl
end

#snObject

Returns the value of attribute sn.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def sn
  @sn
end

#spObject

Returns the value of attribute sp.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def sp
  @sp
end

#srObject

Returns the value of attribute sr.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def sr
  @sr
end

#stObject

Returns the value of attribute st.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def st
  @st
end

#t1Object

Returns the value of attribute t1.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def t1
  @t1
end

#t2Object

Returns the value of attribute t2.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def t2
  @t2
end

#t3Object

Returns the value of attribute t3.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def t3
  @t3
end

#u1Object

Returns the value of attribute u1.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u1
  @u1
end

#u10Object

Returns the value of attribute u10.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u10
  @u10
end

#u11Object

Returns the value of attribute u11.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u11
  @u11
end

#u12Object

Returns the value of attribute u12.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u12
  @u12
end

#u13Object

Returns the value of attribute u13.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u13
  @u13
end

#u14Object

Returns the value of attribute u14.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u14
  @u14
end

#u15Object

Returns the value of attribute u15.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u15
  @u15
end

#u2Object

Returns the value of attribute u2.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u2
  @u2
end

#u3Object

Returns the value of attribute u3.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u3
  @u3
end

#u4Object

Returns the value of attribute u4.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u4
  @u4
end

#u5Object

Returns the value of attribute u5.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u5
  @u5
end

#u6Object

Returns the value of attribute u6.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u6
  @u6
end

#u7Object

Returns the value of attribute u7.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u7
  @u7
end

#u8Object

Returns the value of attribute u8.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u8
  @u8
end

#u9Object

Returns the value of attribute u9.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def u9
  @u9
end

#ulObject

Returns the value of attribute ul.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def ul
  @ul
end

#voObject

Returns the value of attribute vo.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def vo
  @vo
end

#wpObject

Returns the value of attribute wp.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def wp
  @wp
end

#wtObject

Returns the value of attribute wt.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def wt
  @wt
end

#wvObject

Returns the value of attribute wv.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def wv
  @wv
end

#yrObject

Returns the value of attribute yr.



6
7
8
# File 'lib/refworks/reference.rb', line 6

def yr
  @yr
end

Instance Method Details

#abstractObject



405
406
407
# File 'lib/refworks/reference.rb', line 405

def abstract
  ab
end

#abstract=(val) ⇒ Object



409
410
411
# File 'lib/refworks/reference.rb', line 409

def abstract=(val)
  self.ab=val
end

#accession_numberObject



517
518
519
# File 'lib/refworks/reference.rb', line 517

def accession_number
  an
end

#accession_number=(val) ⇒ Object



521
522
523
# File 'lib/refworks/reference.rb', line 521

def accession_number=(val)
  self.an=val
end

#author_addressObject



509
510
511
# File 'lib/refworks/reference.rb', line 509

def author_address
  ad
end

#author_address=(val) ⇒ Object



513
514
515
# File 'lib/refworks/reference.rb', line 513

def author_address=(val)
  self.ad=val
end

#authorsObject

alias



299
300
301
# File 'lib/refworks/reference.rb', line 299

def authors
  a1
end

#authors=(val) ⇒ Object

alias



304
305
306
# File 'lib/refworks/reference.rb', line 304

def authors=(val)
  self.a1 = val.class == Array ? val : val.lines.to_a
end

#availabilityObject



501
502
503
# File 'lib/refworks/reference.rb', line 501

def availability
  av
end

#availability=(val) ⇒ Object



505
506
507
# File 'lib/refworks/reference.rb', line 505

def availability=(val)
  self.av=val
end

#call_numberObject



587
588
589
# File 'lib/refworks/reference.rb', line 587

def call_number
  cn
end

#call_number=(val) ⇒ Object



591
592
593
# File 'lib/refworks/reference.rb', line 591

def call_number=(val)
  self.cn=val
end

#cited_referencesObject



779
780
781
# File 'lib/refworks/reference.rb', line 779

def cited_references
  cr
end

#cited_references=(val) ⇒ Object



783
784
785
# File 'lib/refworks/reference.rb', line 783

def cited_references=(val)
  self.cr=val
end

#classificationObject



533
534
535
# File 'lib/refworks/reference.rb', line 533

def classification
  cl
end

#classification=(val) ⇒ Object



537
538
539
# File 'lib/refworks/reference.rb', line 537

def classification=(val)
  self.cl=val
end

#created_dateObject

extension



833
834
835
# File 'lib/refworks/reference.rb', line 833

def created_date
  cd
end

#data_sourceObject



603
604
605
# File 'lib/refworks/reference.rb', line 603

def data_source
  ds
end

#data_source=(val) ⇒ Object



607
608
609
# File 'lib/refworks/reference.rb', line 607

def data_source=(val)
  self.ds=val
end

#databaseObject



595
596
597
# File 'lib/refworks/reference.rb', line 595

def database
  db
end

#database=(val) ⇒ Object



599
600
601
# File 'lib/refworks/reference.rb', line 599

def database=(val)
  self.db=val
end

#date_of_electronic_publicationObject



811
812
813
# File 'lib/refworks/reference.rb', line 811

def date_of_electronic_publication
  wp
end

#date_of_electronic_publication=(val) ⇒ Object



815
816
817
# File 'lib/refworks/reference.rb', line 815

def date_of_electronic_publication=(val)
  self.wp=val
end

#digital_object_identifierObject



565
566
567
568
# File 'lib/refworks/reference.rb', line 565

def digital_object_identifier
  # @ sign to avoid collision with Ruby keyword 'do'
  @do
end

#digital_object_identifier=(val) ⇒ Object



570
571
572
573
# File 'lib/refworks/reference.rb', line 570

def digital_object_identifier=(val)
  # @ sign to avoid collision with Ruby keyword 'do'
  @do=val
end

#doiObject

alias



576
577
578
579
# File 'lib/refworks/reference.rb', line 576

def doi
  # @ sign to avoid collision with Ruby keyword 'do'
  @do
end

#doi=(val) ⇒ Object

alias



582
583
584
585
# File 'lib/refworks/reference.rb', line 582

def doi=(val)
  # @ sign to avoid collision with Ruby keyword 'do'
  @do=val
end

#editionObject



437
438
439
# File 'lib/refworks/reference.rb', line 437

def edition
  ed
end

#edition=(val) ⇒ Object



441
442
443
# File 'lib/refworks/reference.rb', line 441

def edition=(val)
  self.ed=val
end

#folderObject

extension



828
829
830
# File 'lib/refworks/reference.rb', line 828

def folder
  fl
end

#identifying_phraseObject



611
612
613
# File 'lib/refworks/reference.rb', line 611

def identifying_phrase
  ip
end

#identifying_phrase=(val) ⇒ Object



615
616
617
# File 'lib/refworks/reference.rb', line 615

def identifying_phrase=(val)
  self.ip=val
end

#issn_isbnObject



493
494
495
# File 'lib/refworks/reference.rb', line 493

def issn_isbn
  sn
end

#issn_isbn=(val) ⇒ Object



497
498
499
# File 'lib/refworks/reference.rb', line 497

def issn_isbn=(val)
  self.sn=val
end

#issueObject



365
366
367
# File 'lib/refworks/reference.rb', line 365

def issue
  is
end

#issue=(val) ⇒ Object



369
370
371
# File 'lib/refworks/reference.rb', line 369

def issue=(val)
  self.is=val
end

#keywordObject



389
390
391
# File 'lib/refworks/reference.rb', line 389

def keyword
  k1
end

#keyword=(val) ⇒ Object



393
394
395
# File 'lib/refworks/reference.rb', line 393

def keyword=(val)
  self.k1 = val
end

#keywordsObject



397
398
399
# File 'lib/refworks/reference.rb', line 397

def keywords
  k1
end

#keywords=(val) ⇒ Object



401
402
403
# File 'lib/refworks/reference.rb', line 401

def keywords=(val)
  self.k1 = val
end

#languageObject



525
526
527
# File 'lib/refworks/reference.rb', line 525

def language
  la
end

#language=(val) ⇒ Object



529
530
531
# File 'lib/refworks/reference.rb', line 529

def language=(val)
  self.la=val
end


557
558
559
# File 'lib/refworks/reference.rb', line 557

def links
  lk
end

#links=(val) ⇒ Object



561
562
563
# File 'lib/refworks/reference.rb', line 561

def links=(val)
  self.lk=val
end

#modified_dataObject

extension



838
839
840
# File 'lib/refworks/reference.rb', line 838

def modified_data
  md
end

#notesObject



413
414
415
# File 'lib/refworks/reference.rb', line 413

def notes
  no
end

#notes=(val) ⇒ Object



417
418
419
# File 'lib/refworks/reference.rb', line 417

def notes=(val)
  self.no=val
end

#original_foreign_titleObject



549
550
551
# File 'lib/refworks/reference.rb', line 549

def original_foreign_title
  ot
end

#original_foreign_title=(val) ⇒ Object



553
554
555
# File 'lib/refworks/reference.rb', line 553

def original_foreign_title=(val)
  self.ot=val
end

#other_pagesObject



381
382
383
# File 'lib/refworks/reference.rb', line 381

def other_pages
  op
end

#other_pages=(val) ⇒ Object



385
386
387
# File 'lib/refworks/reference.rb', line 385

def other_pages=(val)
  self.op=val
end

#output_languageObject



819
820
821
# File 'lib/refworks/reference.rb', line 819

def output_language
  ol
end

#output_language=(val) ⇒ Object



823
824
825
# File 'lib/refworks/reference.rb', line 823

def output_language=(val)
  self.ol=val
end

#periodical_abbrevObject



333
334
335
# File 'lib/refworks/reference.rb', line 333

def periodical_abbrev
  jo
end

#periodical_abbrev=(val) ⇒ Object



337
338
339
# File 'lib/refworks/reference.rb', line 337

def periodical_abbrev=(val)
  self.jo=val
end

#periodical_fullObject



325
326
327
# File 'lib/refworks/reference.rb', line 325

def periodical_full
  jf
end

#periodical_full=(val) ⇒ Object



329
330
331
# File 'lib/refworks/reference.rb', line 329

def periodical_full=(val)
  self.jf=val
end

#place_of_publicationObject



453
454
455
# File 'lib/refworks/reference.rb', line 453

def place_of_publication
  pp
end

#place_of_publication=(val) ⇒ Object



457
458
459
# File 'lib/refworks/reference.rb', line 457

def place_of_publication=(val)
  self.pp=val
end

#primary_authorsObject



290
291
292
# File 'lib/refworks/reference.rb', line 290

def primary_authors
  a1
end

#primary_authors=(val) ⇒ Object



294
295
296
# File 'lib/refworks/reference.rb', line 294

def primary_authors=(val)
  self.a1 = val.class == Array ? val : val.lines.to_a
end

#primary_titleObject



308
309
310
# File 'lib/refworks/reference.rb', line 308

def primary_title
  t1
end

#primary_title=(val) ⇒ Object



312
313
314
# File 'lib/refworks/reference.rb', line 312

def primary_title=(val)
  self.t1 = val
end

#publication_data_free_formObject



349
350
351
# File 'lib/refworks/reference.rb', line 349

def publication_data_free_form
  fd
end

#publication_data_free_form=(val) ⇒ Object



353
354
355
# File 'lib/refworks/reference.rb', line 353

def publication_data_free_form=(val)
  self.fd=val
end

#publication_yearObject



341
342
343
# File 'lib/refworks/reference.rb', line 341

def publication_year
  yr
end

#publication_year=(val) ⇒ Object



345
346
347
# File 'lib/refworks/reference.rb', line 345

def publication_year=(val)
  self.yr=val
end

#publisherObject



445
446
447
# File 'lib/refworks/reference.rb', line 445

def publisher
  pb
end

#publisher=(val) ⇒ Object



449
450
451
# File 'lib/refworks/reference.rb', line 449

def publisher=(val)
  self.pb=val
end

#quaternary_authorsObject



469
470
471
# File 'lib/refworks/reference.rb', line 469

def quaternary_authors
  a4
end

#quaternary_authors=(val) ⇒ Object



473
474
475
# File 'lib/refworks/reference.rb', line 473

def quaternary_authors=(val)
  self.a4= val.class == Array ? val : val.lines.to_a
end

#quinary_authorsObject



477
478
479
# File 'lib/refworks/reference.rb', line 477

def quinary_authors
  a5
end

#quinary_authors=(val) ⇒ Object



481
482
483
# File 'lib/refworks/reference.rb', line 481

def quinary_authors=(val)
  self.a5= val.class == Array ? val : val.lines.to_a
end

#reference_typeObject

setup human-readable aliases as accessors I’ve been consistent with the RefWorks tagged format legend (see end of this file) plus I added some additional ones (like “authors” as a synonym for “primary_authors”) which seemed particularly useful.



264
265
266
# File 'lib/refworks/reference.rb', line 264

def reference_type
  rt
end

#reference_type=(val) ⇒ Object



268
269
270
# File 'lib/refworks/reference.rb', line 268

def reference_type=(val)
  self.rt = val
end

#reference_type_numObject

extension



273
274
275
# File 'lib/refworks/reference.rb', line 273

def reference_type_num
  rt_num
end

#reference_type_stringObject

extension



278
279
280
# File 'lib/refworks/reference.rb', line 278

def reference_type_string
  rt_string
end

#retrieved_dateObject



619
620
621
# File 'lib/refworks/reference.rb', line 619

def retrieved_date
  rd
end

#retrieved_date=(val) ⇒ Object



623
624
625
# File 'lib/refworks/reference.rb', line 623

def retrieved_date=(val)
  self.rd=val
end

#secondary_authorsObject



421
422
423
# File 'lib/refworks/reference.rb', line 421

def secondary_authors
  a2
end

#secondary_authors=(val) ⇒ Object



425
426
427
# File 'lib/refworks/reference.rb', line 425

def secondary_authors=(val)
  self.a2= val.class == Array ? val : val.lines.to_a
end

#secondary_titleObject



429
430
431
# File 'lib/refworks/reference.rb', line 429

def secondary_title
  t2
end

#secondary_title=(val) ⇒ Object



433
434
435
# File 'lib/refworks/reference.rb', line 433

def secondary_title=(val)
  self.t2=val
end

#shortened_titleObject



627
628
629
# File 'lib/refworks/reference.rb', line 627

def shortened_title
  st
end

#shortened_title=(val) ⇒ Object



631
632
633
# File 'lib/refworks/reference.rb', line 631

def shortened_title=(val)
  self.st=val
end

#source_typeObject



282
283
284
# File 'lib/refworks/reference.rb', line 282

def source_type
  sr
end

#source_type=(val) ⇒ Object



286
287
288
# File 'lib/refworks/reference.rb', line 286

def source_type=(val)
  self.sr = val
end

#sponsoring_libraryObject



763
764
765
# File 'lib/refworks/reference.rb', line 763

def sponsoring_library
  sl
end

#sponsoring_library=(val) ⇒ Object



767
768
769
# File 'lib/refworks/reference.rb', line 767

def sponsoring_library=(val)
  self.sl=val
end

#sponsoring_library_locationObject



771
772
773
# File 'lib/refworks/reference.rb', line 771

def sponsoring_library_location
  ll
end

#sponsoring_library_location=(val) ⇒ Object



775
776
777
# File 'lib/refworks/reference.rb', line 775

def sponsoring_library_location=(val)
  self.ll=val
end

#start_pageObject



373
374
375
# File 'lib/refworks/reference.rb', line 373

def start_page
  sp
end

#start_page=(val) ⇒ Object



377
378
379
# File 'lib/refworks/reference.rb', line 377

def start_page=(val)
  self.sp=val
end

#subfile_databaseObject



541
542
543
# File 'lib/refworks/reference.rb', line 541

def subfile_database
  sf
end

#subfile_database=(val) ⇒ Object



545
546
547
# File 'lib/refworks/reference.rb', line 545

def subfile_database=(val)
  self.sf=val
end

#tertiary_authorsObject



461
462
463
# File 'lib/refworks/reference.rb', line 461

def tertiary_authors
  a3
end

#tertiary_authors=(val) ⇒ Object



465
466
467
# File 'lib/refworks/reference.rb', line 465

def tertiary_authors=(val)
  self.a3= val.class == Array ? val : val.lines.to_a
end

#tertiary_titleObject



485
486
487
# File 'lib/refworks/reference.rb', line 485

def tertiary_title
  t3
end

#tertiary_title=(val) ⇒ Object



489
490
491
# File 'lib/refworks/reference.rb', line 489

def tertiary_title=(val)
  self.t3=val
end

#titleObject

alias



317
318
319
# File 'lib/refworks/reference.rb', line 317

def title
  t1
end

#title=(val) ⇒ Object



321
322
323
# File 'lib/refworks/reference.rb', line 321

def title=(val)
  self.t1=val
end

#to_refworks_xmlObject

method to produce RefWorks XML format



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/refworks/reference.rb', line 180

def to_refworks_xml
  @xml = "<reference>"

  @xml << "<rt>#{rt_string}</rt>" if @rt
  @xml << "<sr>#{sr}</sr>" if @sr
  @xml << "<id>#{id}</id>" if @id
  a1.each {|a| @xml << "<a1>#{a}</a1>"} if @a1
  @xml << "<t1>#{t1}</t1>" if @t1
  @xml << "<jf>#{jf}</jf>" if @jf
  @xml << "<jo>#{jo}</jo>" if @jo
  @xml << "<yr>#{yr}</yr>" if @yr
  @xml << "<fd>#{fd}</fd>" if @fd
  @xml << "<vo>#{vo}</vo>" if @vo
  @xml << "<is>#{is}</is>" if @is
  @xml << "<sp>#{sp}</sp>" if @sp
  @xml << "<op>#{op}</op>" if @op
  k1.each {|k| @xml << "<k1>#{k1}</k1>"} if @k1
  @xml << "<ab>#{ab}</ab>" if @ab
  @xml << "<no>#{no}</no>" if @no
  a2.each {|a| @xml << "<a2>#{a}</a2>"} if @a2
  @xml << "<t2>#{t2}</t2>" if @t2
  @xml << "<ed>#{ed}</ed>" if @ed
  @xml << "<pb>#{pb}</pb>" if @pb
  @xml << "<pp>#{pp}</pp>" if @pp
  a3.each {|a| @xml << "<a3>#{a}</a3>"} if @a3
  a4.each {|a| @xml << "<a4>#{a}</a4>"} if @a4
  a5.each {|a| @xml << "<a5>#{a}</a5>"} if @a5
  @xml << "<t3>#{t3}</t3>" if @t3
  @xml << "<sn>#{sn}</sn>" if @sn
  @xml << "<av>#{av}</av>" if @av
  @xml << "<ad>#{ad}</ad>" if @ad
  @xml << "<an>#{an}</an>" if @an
  @xml << "<la>#{la}</la>" if @la
  @xml << "<cl>#{cl}</cl>" if @cl
  @xml << "<sf>#{sf}</sf>" if @sf
  @xml << "<ot>#{ot}</ot>" if @ot
  @xml << "<lk>#{lk}</lk>" if @lk
  @xml << "<do>#{@do}</do>" if @do
  @xml << "<cn>#{cn}</cn>" if @cn
  @xml << "<db>#{db}</db>" if @db
  @xml << "<ds>#{ds}</ds>" if @ds
  @xml << "<ip>#{ip}</ip>" if @ip
  @xml << "<rd>#{rd}</rd>" if @rd
  @xml << "<st>#{st}</st>" if @st
  @xml << "<u1>#{u1}</u1>" if @u1
  @xml << "<u2>#{u2}</u2>" if @u2
  @xml << "<u3>#{u3}</u3>" if @u3
  @xml << "<u4>#{u4}</u4>" if @u4
  @xml << "<u5>#{u5}</u5>" if @u5
  @xml << "<u6>#{u6}</u6>" if @u6
  @xml << "<u7>#{u7}</u7>" if @u7
  @xml << "<u8>#{u8}</u8>" if @u8
  @xml << "<u9>#{u9}</u9>" if @u9
  @xml << "<u10>#{u10}</u10>" if @u10
  @xml << "<u11>#{u11}</u11>" if @u11
  @xml << "<u12>#{u12}</u12>" if @u12
  @xml << "<u13>#{u13}</u13>" if @u13
  @xml << "<u14>#{u14}</u14>" if @u14
  @xml << "<u15>#{u15}</u15>" if @u15
  @xml << "<ul>#{ul}</ul>" if @ul
  @xml << "<sl>#{sl}</sl>" if @sl
  @xml << "<ll>#{ll}</ll>" if @ll
  @xml << "<cr>#{cr}</cr>" if @cr
  @xml << "<wt>#{wt}</wt>" if @wt
  a6.each {|a| @xml << "<a6>#{a}</a6>"} if @a6
  @xml << "<wv>#{wv}</wv>" if @wv
  @xml << "<wp>#{wp}</wp>" if @wp
  @xml << "<ol>#{ol}</ol>" if @ol
  @xml << "<pmid>#{pmid}</pmid>" if @pmid
  @xml << "<pmcid>#{pmcid}</pmcid>" if @pmcid
  # suppressing these - they are not part of the spec and RW trips if you try to add a ref with these
  #@xml << "<fl>#{fl}</fl>" if @fl
  #@xml << "<cd>#{cd}</cd>" if @cd
  #@xml << "<md>#{md}</md>" if @md

  @xml << "</reference>"
  @xml
end

#urlObject



755
756
757
# File 'lib/refworks/reference.rb', line 755

def url
  ul
end

#url=(val) ⇒ Object



759
760
761
# File 'lib/refworks/reference.rb', line 759

def url=(val)
  self.ul=val
end

#user_1Object



635
636
637
# File 'lib/refworks/reference.rb', line 635

def user_1
  u1
end

#user_10Object



707
708
709
# File 'lib/refworks/reference.rb', line 707

def user_10
  u10
end

#user_10=(val) ⇒ Object



711
712
713
# File 'lib/refworks/reference.rb', line 711

def user_10=(val)
  self.u10=val
end

#user_11Object



715
716
717
# File 'lib/refworks/reference.rb', line 715

def user_11
  u11
end

#user_11=(val) ⇒ Object



719
720
721
# File 'lib/refworks/reference.rb', line 719

def user_11=(val)
  self.u11=val
end

#user_12Object



723
724
725
# File 'lib/refworks/reference.rb', line 723

def user_12
  u12
end

#user_12=(val) ⇒ Object



727
728
729
# File 'lib/refworks/reference.rb', line 727

def user_12=(val)
  self.u12=val
end

#user_13Object



731
732
733
# File 'lib/refworks/reference.rb', line 731

def user_13
  u13
end

#user_13=(val) ⇒ Object



735
736
737
# File 'lib/refworks/reference.rb', line 735

def user_13=(val)
  self.u13=val
end

#user_14Object



739
740
741
# File 'lib/refworks/reference.rb', line 739

def user_14
  u14
end

#user_14=(val) ⇒ Object



743
744
745
# File 'lib/refworks/reference.rb', line 743

def user_14=(val)
  self.u14=val
end

#user_15Object



747
748
749
# File 'lib/refworks/reference.rb', line 747

def user_15
  u15
end

#user_15=(val) ⇒ Object



751
752
753
# File 'lib/refworks/reference.rb', line 751

def user_15=(val)
  self.u15=val
end

#user_1=(val) ⇒ Object



639
640
641
# File 'lib/refworks/reference.rb', line 639

def user_1=(val)
  self.u1=val
end

#user_2Object



643
644
645
# File 'lib/refworks/reference.rb', line 643

def user_2
  u2
end

#user_2=(val) ⇒ Object



647
648
649
# File 'lib/refworks/reference.rb', line 647

def user_2=(val)
  self.u2=val
end

#user_3Object



651
652
653
# File 'lib/refworks/reference.rb', line 651

def user_3
  u3
end

#user_3=(val) ⇒ Object



655
656
657
# File 'lib/refworks/reference.rb', line 655

def user_3=(val)
  self.u3=val
end

#user_4Object



659
660
661
# File 'lib/refworks/reference.rb', line 659

def user_4
  u4
end

#user_4=(val) ⇒ Object



663
664
665
# File 'lib/refworks/reference.rb', line 663

def user_4=(val)
  self.u4=val
end

#user_5Object



667
668
669
# File 'lib/refworks/reference.rb', line 667

def user_5
  u5
end

#user_5=(val) ⇒ Object



671
672
673
# File 'lib/refworks/reference.rb', line 671

def user_5=(val)
  self.u5=val
end

#user_6Object



675
676
677
# File 'lib/refworks/reference.rb', line 675

def user_6
  u6
end

#user_6=(val) ⇒ Object



679
680
681
# File 'lib/refworks/reference.rb', line 679

def user_6=(val)
  self.u6=val
end

#user_7Object



683
684
685
# File 'lib/refworks/reference.rb', line 683

def user_7
  u7
end

#user_7=(val) ⇒ Object



687
688
689
# File 'lib/refworks/reference.rb', line 687

def user_7=(val)
  self.u7=val
end

#user_8Object



691
692
693
# File 'lib/refworks/reference.rb', line 691

def user_8
  u8
end

#user_8=(val) ⇒ Object



695
696
697
# File 'lib/refworks/reference.rb', line 695

def user_8=(val)
  self.u8=val
end

#user_9Object



699
700
701
# File 'lib/refworks/reference.rb', line 699

def user_9
  u9
end

#user_9=(val) ⇒ Object



703
704
705
# File 'lib/refworks/reference.rb', line 703

def user_9=(val)
  self.u9=val
end

#volumeObject



357
358
359
# File 'lib/refworks/reference.rb', line 357

def volume
  vo
end

#volume=(val) ⇒ Object



361
362
363
# File 'lib/refworks/reference.rb', line 361

def volume=(val)
  self.vo=val
end

#website_editorsObject



795
796
797
# File 'lib/refworks/reference.rb', line 795

def website_editors
  a6
end

#website_editors=(val) ⇒ Object



799
800
801
# File 'lib/refworks/reference.rb', line 799

def website_editors=(val)
  self.a6= val.class == Array ? val : val.lines.to_a
end

#website_titleObject



787
788
789
# File 'lib/refworks/reference.rb', line 787

def website_title
  wt
end

#website_title=(val) ⇒ Object



791
792
793
# File 'lib/refworks/reference.rb', line 791

def website_title=(val)
  self.wt=val
end

#website_versionObject



803
804
805
# File 'lib/refworks/reference.rb', line 803

def website_version
  wv
end

#website_version=(val) ⇒ Object



807
808
809
# File 'lib/refworks/reference.rb', line 807

def website_version=(val)
  self.wv=val
end