Class: EBSCO::EDS::Info
- Inherits:
-
Object
- Object
- EBSCO::EDS::Info
- Defined in:
- lib/ebsco/eds/info.rb
Instance Attribute Summary collapse
-
#api_settings ⇒ Object
Returns the value of attribute api_settings.
-
#application_settings ⇒ Object
Returns the value of attribute application_settings.
-
#available_search_criteria ⇒ Object
Returns the value of attribute available_search_criteria.
-
#citation_style_settings ⇒ Object
Returns the value of attribute citation_style_settings.
-
#export_format_settings ⇒ Object
Returns the value of attribute export_format_settings.
-
#view_result_settings ⇒ Object
Returns the value of attribute view_result_settings.
Instance Method Summary collapse
-
#available_actions ⇒ Object
AVAILABLE ACTIONS ====================================================================================.
- #available_citation_exports(id = 'all') ⇒ Object
-
#available_citation_styles(id = 'all') ⇒ Object
CITATION STYLES AND EXPORT FORMATS ====================================================================================.
-
#available_expander_ids ⇒ Object
EXPANDERS ====================================================================================.
- #available_expanders(id = 'all') ⇒ Object
-
#available_limiter_ids ⇒ Object
LIMITERS ====================================================================================.
- #available_limiter_labels ⇒ Object
-
#available_limiter_values(id) ⇒ Object
get an array of limiter values for a Type=multiselectvalue limiter.
- #available_limiters(id = 'all') ⇒ Object
- #available_related_content(type = 'all') ⇒ Object
-
#available_related_content_types ⇒ Object
RELATED CONTENT ====================================================================================.
- #available_result_list_views ⇒ Object
- #available_search_mode_types ⇒ Object
-
#available_search_modes(mode = 'all_available') ⇒ Object
SEARCH MODES ====================================================================================.
-
#available_sorts(id = 'all') ⇒ Object
SORTS ====================================================================================.
- #default_auto_correct ⇒ Object
- #default_auto_suggest ⇒ Object
- #default_expander_ids ⇒ Object
- #default_highlight ⇒ Object
- #default_include_image_quick_view ⇒ Object
- #default_limiter_ids ⇒ Object
- #default_limiter_labels ⇒ Object
- #default_related_content_types ⇒ Object
- #default_result_list_view ⇒ Object
-
#default_results_per_page ⇒ Object
RESULTS VIEW SETTINGS ====================================================================================.
- #default_search_mode ⇒ Object
-
#did_you_mean(id = 'all') ⇒ Object
AUTO SUGGEST ====================================================================================.
- #get_limiter_by_label(label) ⇒ Object
-
#initialize(info, config = {}) ⇒ Info
constructor
A new instance of Info.
-
#max_record_jump ⇒ Object
API SETTINGS ====================================================================================.
- #max_results_per_page ⇒ Object
-
#search_fields(code = 'all') ⇒ Object
SEARCH FIELDS ====================================================================================.
-
#session_timeout ⇒ Object
APPLICATION SETTINGS ====================================================================================.
Constructor Details
#initialize(info, config = {}) ⇒ Info
Returns a new instance of Info.
10 11 12 13 14 15 16 17 18 |
# File 'lib/ebsco/eds/info.rb', line 10 def initialize(info, config = {}) @results_per_page = config[:max_results_per_page] ? config[:max_results_per_page] : 100 @available_search_criteria = info['AvailableSearchCriteria'] @view_result_settings = info['ViewResultSettings'] @application_settings = info['ApplicationSettings'] @api_settings = info['ApiSettings'] @citation_style_settings = info['CitationStyleSettings'] @export_format_settings = info['ExportFormatSettings'] end |
Instance Attribute Details
#api_settings ⇒ Object
Returns the value of attribute api_settings.
8 9 10 |
# File 'lib/ebsco/eds/info.rb', line 8 def api_settings @api_settings end |
#application_settings ⇒ Object
Returns the value of attribute application_settings.
8 9 10 |
# File 'lib/ebsco/eds/info.rb', line 8 def application_settings @application_settings end |
#available_search_criteria ⇒ Object
Returns the value of attribute available_search_criteria.
8 9 10 |
# File 'lib/ebsco/eds/info.rb', line 8 def available_search_criteria @available_search_criteria end |
#citation_style_settings ⇒ Object
Returns the value of attribute citation_style_settings.
8 9 10 |
# File 'lib/ebsco/eds/info.rb', line 8 def citation_style_settings @citation_style_settings end |
#export_format_settings ⇒ Object
Returns the value of attribute export_format_settings.
8 9 10 |
# File 'lib/ebsco/eds/info.rb', line 8 def export_format_settings @export_format_settings end |
#view_result_settings ⇒ Object
Returns the value of attribute view_result_settings.
8 9 10 |
# File 'lib/ebsco/eds/info.rb', line 8 def view_result_settings @view_result_settings end |
Instance Method Details
#available_actions ⇒ Object
AVAILABLE ACTIONS
208 209 210 |
# File 'lib/ebsco/eds/info.rb', line 208 def available_actions @available_search_criteria.deep_find_results('AddAction') end |
#available_citation_exports(id = 'all') ⇒ Object
156 157 158 |
# File 'lib/ebsco/eds/info.rb', line 156 def available_citation_exports (id = 'all') @export_format_settings.fetch('AvailableFormats',{}).select{|item| item['Id'] == id || id == 'all'} end |
#available_citation_styles(id = 'all') ⇒ Object
CITATION STYLES AND EXPORT FORMATS
152 153 154 |
# File 'lib/ebsco/eds/info.rb', line 152 def available_citation_styles (id = 'all') @citation_style_settings.fetch('AvailableStyles',{}).select{|item| item['Id'] == id || id == 'all'} end |
#available_expander_ids ⇒ Object
EXPANDERS
56 57 58 |
# File 'lib/ebsco/eds/info.rb', line 56 def @available_search_criteria.fetch('AvailableExpanders',{}).map{|hash| hash['Id']} end |
#available_expanders(id = 'all') ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/ebsco/eds/info.rb', line 64 def (id = 'all') if id == 'all' @available_search_criteria.fetch('AvailableExpanders',{}) else @available_search_criteria.fetch('AvailableExpanders',{}).find{|item| item['Id'] == id} end end |
#available_limiter_ids ⇒ Object
LIMITERS
76 77 78 |
# File 'lib/ebsco/eds/info.rb', line 76 def available_limiter_ids @available_search_criteria.fetch('AvailableLimiters',{}).map{|hash| hash['Id']} end |
#available_limiter_labels ⇒ Object
96 97 98 |
# File 'lib/ebsco/eds/info.rb', line 96 def available_limiter_labels @available_search_criteria.fetch('AvailableLimiters',{}).map{|hash| hash['Label']} end |
#available_limiter_values(id) ⇒ Object
get an array of limiter values for a Type=multiselectvalue limiter
101 102 103 104 105 106 |
# File 'lib/ebsco/eds/info.rb', line 101 def available_limiter_values (id) _limiter = @available_search_criteria.fetch('AvailableLimiters',{}).find{|item| item['Id'] == id} if _limiter['Type'] == 'multiselectvalue' _limiter['LimiterValues'].map{|hash| hash['Value']} end end |
#available_limiters(id = 'all') ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/ebsco/eds/info.rb', line 88 def available_limiters (id = 'all') if id == 'all' @available_search_criteria.fetch('AvailableLimiters',{}) else @available_search_criteria.fetch('AvailableLimiters',{}).find{|item| item['Id'] == id} end end |
#available_related_content(type = 'all') ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/ebsco/eds/info.rb', line 124 def (type = 'all') if type == 'all' @available_search_criteria.fetch('AvailableRelatedContent',{}) else @available_search_criteria.fetch('AvailableRelatedContent',{}).find{|item| item['Type'] == type} end end |
#available_related_content_types ⇒ Object
RELATED CONTENT
116 117 118 |
# File 'lib/ebsco/eds/info.rb', line 116 def .map{|hash| hash['Type'] } end |
#available_result_list_views ⇒ Object
172 173 174 |
# File 'lib/ebsco/eds/info.rb', line 172 def available_result_list_views %w{brief title detailed} end |
#available_search_mode_types ⇒ Object
44 45 46 |
# File 'lib/ebsco/eds/info.rb', line 44 def available_search_mode_types available_search_modes.map{|hash| hash['Mode']} end |
#available_search_modes(mode = 'all_available') ⇒ Object
SEARCH MODES
40 41 42 |
# File 'lib/ebsco/eds/info.rb', line 40 def available_search_modes (mode = 'all_available') @available_search_criteria.fetch('AvailableSearchModes',{}).select{|item| item['Mode'] == mode || mode == 'all_available'} end |
#available_sorts(id = 'all') ⇒ Object
SORTS
24 25 26 |
# File 'lib/ebsco/eds/info.rb', line 24 def available_sorts (id = 'all') @available_search_criteria.fetch('AvailableSorts',{}).select{|item| item['Id'] == id || id == 'all'} end |
#default_auto_correct ⇒ Object
144 145 146 |
# File 'lib/ebsco/eds/info.rb', line 144 def default_auto_correct @available_search_criteria.fetch('AvailableDidYouMeanOptions',{}).find{|item| item['Id'] == 'AutoCorrect'}['DefaultOn'] end |
#default_auto_suggest ⇒ Object
140 141 142 |
# File 'lib/ebsco/eds/info.rb', line 140 def default_auto_suggest @available_search_criteria.fetch('AvailableDidYouMeanOptions',{}).find{|item| item['Id'] == 'AutoSuggest'}['DefaultOn'] end |
#default_expander_ids ⇒ Object
60 61 62 |
# File 'lib/ebsco/eds/info.rb', line 60 def @available_search_criteria.fetch('AvailableExpanders',{}).select{|item| item['DefaultOn'] == 'y'}.map{|hash| hash['Id']} end |
#default_highlight ⇒ Object
180 181 182 |
# File 'lib/ebsco/eds/info.rb', line 180 def default_highlight true end |
#default_include_image_quick_view ⇒ Object
184 185 186 |
# File 'lib/ebsco/eds/info.rb', line 184 def default_include_image_quick_view false end |
#default_limiter_ids ⇒ Object
80 81 82 |
# File 'lib/ebsco/eds/info.rb', line 80 def default_limiter_ids @available_search_criteria.fetch('AvailableLimiters',{}).select{|item| item['DefaultOn'] == 'y'}.map{|hash| hash['Id']} end |
#default_limiter_labels ⇒ Object
84 85 86 |
# File 'lib/ebsco/eds/info.rb', line 84 def default_limiter_labels @available_search_criteria.fetch('AvailableLimiters',{}).select{|item| item['DefaultOn'] == 'y'}.map{|hash| hash['Label']} end |
#default_related_content_types ⇒ Object
120 121 122 |
# File 'lib/ebsco/eds/info.rb', line 120 def @available_search_criteria.fetch('AvailableRelatedContent',{}).select{|item| item['DefaultOn'] == 'y'}.map{|hash| hash['Type']} end |
#default_result_list_view ⇒ Object
176 177 178 |
# File 'lib/ebsco/eds/info.rb', line 176 def default_result_list_view @view_result_settings['ResultListView'] end |
#default_results_per_page ⇒ Object
RESULTS VIEW SETTINGS
164 165 166 |
# File 'lib/ebsco/eds/info.rb', line 164 def default_results_per_page @view_result_settings['ResultsPerPage'].to_i end |
#default_search_mode ⇒ Object
48 49 50 |
# File 'lib/ebsco/eds/info.rb', line 48 def default_search_mode @available_search_criteria.fetch('AvailableSearchModes',{}).find{|item| item['DefaultOn'] == 'y'}['Mode'] end |
#did_you_mean(id = 'all') ⇒ Object
AUTO SUGGEST
136 137 138 |
# File 'lib/ebsco/eds/info.rb', line 136 def did_you_mean (id = 'all') @available_search_criteria.fetch('AvailableDidYouMeanOptions',{}).select{|item| item['Id'] == id || id == 'all'} end |
#get_limiter_by_label(label) ⇒ Object
108 109 110 |
# File 'lib/ebsco/eds/info.rb', line 108 def get_limiter_by_label (label) @available_search_criteria.fetch('AvailableLimiters',{}).find{|item| item['Label'] == label} end |
#max_record_jump ⇒ Object
API SETTINGS
192 193 194 |
# File 'lib/ebsco/eds/info.rb', line 192 def max_record_jump @api_settings['MaxRecordJumpAhead'] end |
#max_results_per_page ⇒ Object
168 169 170 |
# File 'lib/ebsco/eds/info.rb', line 168 def max_results_per_page @results_per_page end |
#search_fields(code = 'all') ⇒ Object
SEARCH FIELDS
32 33 34 |
# File 'lib/ebsco/eds/info.rb', line 32 def search_fields (code = 'all') @available_search_criteria.fetch('AvailableSearchFields',{}).select{|item| item['FieldCode'] == code || code == 'all'} end |
#session_timeout ⇒ Object
APPLICATION SETTINGS
200 201 202 |
# File 'lib/ebsco/eds/info.rb', line 200 def session_timeout @application_settings['SessionTimeout'] end |