Class: Textminer::Response
- Inherits:
-
Object
- Object
- Textminer::Response
- Defined in:
- lib/textminer/response.rb
Overview
:nodoc:
Instance Attribute Summary (collapse)
-
- (Object) doi
readonly
Returns the value of attribute doi.
-
- (Object) facet
readonly
Returns the value of attribute facet.
-
- (Object) member
readonly
Returns the value of attribute member.
-
- (Object) response
readonly
Returns the value of attribute response.
Instance Method Summary (collapse)
- - (Object) body
-
- (Response) initialize(doi, member, response, facet)
constructor
A new instance of Response.
- - (Object) inspect
- - (Object) links(just_urls = true)
- - (Object) links_pdf(just_urls = true)
- - (Object) links_plain(just_urls = true)
- - (Object) links_xml(just_urls = true)
- - (Object) to_s
Constructor Details
- (Response) initialize(doi, member, response, facet)
Returns a new instance of Response
9 10 11 12 13 14 |
# File 'lib/textminer/response.rb', line 9 def initialize(doi, member, response, facet) @doi = doi @member = member @response = response @facet = facet end |
Instance Attribute Details
- (Object) doi (readonly)
Returns the value of attribute doi
7 8 9 |
# File 'lib/textminer/response.rb', line 7 def doi @doi end |
- (Object) facet (readonly)
Returns the value of attribute facet
7 8 9 |
# File 'lib/textminer/response.rb', line 7 def facet @facet end |
- (Object) member (readonly)
Returns the value of attribute member
7 8 9 |
# File 'lib/textminer/response.rb', line 7 def member @member end |
- (Object) response (readonly)
Returns the value of attribute response
7 8 9 |
# File 'lib/textminer/response.rb', line 7 def response @response end |
Instance Method Details
- (Object) body
38 39 40 |
# File 'lib/textminer/response.rb', line 38 def body @response end |
- (Object) inspect
34 35 36 |
# File 'lib/textminer/response.rb', line 34 def inspect to_s end |
- (Object) links(just_urls = true)
42 43 44 45 |
# File 'lib/textminer/response.rb', line 42 def links(just_urls = true) tmp = @response.links(just_urls) compactif(tmp) end |
- (Object) links_pdf(just_urls = true)
52 53 54 55 |
# File 'lib/textminer/response.rb', line 52 def links_pdf(just_urls = true) tmp = @response.links_pdf(just_urls) compactif(tmp) end |
- (Object) links_plain(just_urls = true)
57 58 59 60 |
# File 'lib/textminer/response.rb', line 57 def links_plain(just_urls = true) tmp = @response.links_plain(just_urls) compactif(tmp) end |
- (Object) links_xml(just_urls = true)
47 48 49 50 |
# File 'lib/textminer/response.rb', line 47 def links_xml(just_urls = true) tmp = @response.links_xml(just_urls) compactif(tmp) end |
- (Object) to_s
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/textminer/response.rb', line 16 def to_s if !@doi.nil? if @doi.length > 3 ending = '...' else ending = '' end tt = sprintf('dois: %s %s', Array(@doi)[0..2].join(', '), ending) end if !@member.nil? tt = 'member: ' + @member.to_s end if @doi.nil? && @member.nil? tt = '' end sprintf("<textminer>: \n search: %s\n no. licenses: %s", tt, @facet) end |