Class: MDEXClient::MData::Search

Inherits:
Node
  • Object
show all
Defined in:
lib/mdex_client/mdata/search.rb

Constant Summary collapse

MODES =
%w(All AllAny AllPartial Any Boolean Partial PartialMax Unknown)

Instance Attribute Summary collapse

Attributes inherited from Node

#element

Instance Method Summary collapse

Methods inherited from Node

#css, #dimension_value_state_list, #initialize, #initialize_from_element!, #property_list, #record_list, #xpath

Constructor Details

This class inherits a constructor from MDEXClient::MData::Node

Instance Attribute Details

#enable_snippetingObject

Returns the value of attribute enable_snippeting.



8
9
10
# File 'lib/mdex_client/mdata/search.rb', line 8

def enable_snippeting
  @enable_snippeting
end

#keyObject

Returns the value of attribute key.



8
9
10
# File 'lib/mdex_client/mdata/search.rb', line 8

def key
  @key
end

#modeObject

Returns the value of attribute mode.



8
9
10
# File 'lib/mdex_client/mdata/search.rb', line 8

def mode
  @mode
end

#queryObject

Returns the value of attribute query.



8
9
10
# File 'lib/mdex_client/mdata/search.rb', line 8

def query
  @query
end

#relevance_ranking_strategyObject

Returns the value of attribute relevance_ranking_strategy.



8
9
10
# File 'lib/mdex_client/mdata/search.rb', line 8

def relevance_ranking_strategy
  @relevance_ranking_strategy
end

#snippet_lengthObject

Returns the value of attribute snippet_length.



8
9
10
# File 'lib/mdex_client/mdata/search.rb', line 8

def snippet_length
  @snippet_length
end

Instance Method Details

#write_xml!(xml) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/mdex_client/mdata/search.rb', line 11

def write_xml!(xml)
  attributes = { "Key" => key }
  %w(RelevanceRankingStrategy Mode SnippetLength EnableSnippeting).each do |attribute|
    value = send(attribute.underscore)
    attributes[attribute] = value.to_s if value
  end
  
  xml.mdata :Search, attributes, query
end