Class: BEL::Resource::Search::SearchResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/bel/resource/search/search_result.rb

Overview

Represents an identifier search result.

Examples:

Create with all parameters

SearchResult.new(
  'viral <b>oncogene</b> homolog',
  'http://www.openbel.org/bel/namespace/hgnc-human-genes/391',
  'http://www.openbel.org/bel/namespace/hgnc-human-genes',
  '391',
  'AKT1',
  'v-akt murine thymoma viral oncogene homolog 1',
  ['AKT', 'PKB', 'PRKBA', 'RAC']
)

Create from hash

SearchResult.new({ :pref_label => 'AKT1' })

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ SearchResult

Returns a new instance of SearchResult.



21
22
23
24
25
26
27
28
# File 'lib/bel/resource/search/search_result.rb', line 21

def initialize(*args)
  if args.length == 1 && args.first.is_a?(Hash)
    hash = args.first
    super(*hash.values_at(*self.class.members))
  else
    super
  end
end

Instance Attribute Details

#alt_labelsObject

Returns the value of attribute alt_labels

Returns:

  • (Object)

    the current value of alt_labels



20
21
22
# File 'lib/bel/resource/search/search_result.rb', line 20

def alt_labels
  @alt_labels
end

#identifierObject

Returns the value of attribute identifier

Returns:

  • (Object)

    the current value of identifier



20
21
22
# File 'lib/bel/resource/search/search_result.rb', line 20

def identifier
  @identifier
end

#pref_labelObject

Returns the value of attribute pref_label

Returns:

  • (Object)

    the current value of pref_label



20
21
22
# File 'lib/bel/resource/search/search_result.rb', line 20

def pref_label
  @pref_label
end

#scheme_uriObject

Returns the value of attribute scheme_uri

Returns:

  • (Object)

    the current value of scheme_uri



20
21
22
# File 'lib/bel/resource/search/search_result.rb', line 20

def scheme_uri
  @scheme_uri
end

#snippetObject

Returns the value of attribute snippet

Returns:

  • (Object)

    the current value of snippet



20
21
22
# File 'lib/bel/resource/search/search_result.rb', line 20

def snippet
  @snippet
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



20
21
22
# File 'lib/bel/resource/search/search_result.rb', line 20

def title
  @title
end

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



20
21
22
# File 'lib/bel/resource/search/search_result.rb', line 20

def uri
  @uri
end