Class: Org::Familysearch::Ws::Familytree::V2::Schema::SearchResults

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-fs-stack/enunciate/familytree.rb

Overview

The results of a search.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#closeObject

The total number of close hits.



4155
4156
4157
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4155

def close
  @close
end

#contextIdObject

The context id for repeating the search.



4159
4160
4161
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4159

def contextId
  @contextId
end

#countObject

The number of returned hits.



4151
4152
4153
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4151

def count
  @count
end

#partialObject

The estimated number of partial hits.



4153
4154
4155
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4153

def partial
  @partial
end

#queryObject

query parameters



4161
4162
4163
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4161

def query
  @query
end

#resultsObject

The results in the search.



4157
4158
4159
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4157

def results
  @results
end

Class Method Details

.from_json(o) ⇒ Object

constructs a SearchResults from a (parsed) JSON hash



4199
4200
4201
4202
4203
4204
4205
4206
4207
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4199

def self.from_json(o)
  if o.nil?
    return nil
  else
    inst = new
    inst.init_jaxb_json_hash o
    return inst
  end
end

Instance Method Details

#init_jaxb_json_hash(_o) ⇒ Object

initializes this SearchResults with a json hash



4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4185

def init_jaxb_json_hash(_o)
  @count = Fixnum.from_json(_o['count']) unless _o['count'].nil?
  @partial = Fixnum.from_json(_o['partial']) unless _o['partial'].nil?
  @close = Fixnum.from_json(_o['close']) unless _o['close'].nil?
  if !_o['search'].nil?
    @results = Array.new
    _oa = _o['search']
    _oa.each { | _item | @results.push Org::Familysearch::Ws::Familytree::V2::Schema::SearchResult.from_json(_item) }
  end
  @contextId = String.from_json(_o['contextId']) unless _o['contextId'].nil?
  @query = Org::Familysearch::Ws::Familytree::V2::Schema::SearchMatchParameters.from_json(_o['query']) unless _o['query'].nil?
end

#to_jaxb_json_hashObject

the json hash for this SearchResults



4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4164

def to_jaxb_json_hash
  _h = {}
  _h['count'] = count.to_jaxb_json_hash unless count.nil?
  _h['partial'] = partial.to_jaxb_json_hash unless partial.nil?
  _h['close'] = close.to_jaxb_json_hash unless close.nil?
  if !results.nil?
    _ha = Array.new
    results.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['search'] = _ha
  end
  _h['contextId'] = contextId.to_jaxb_json_hash unless contextId.nil?
  _h['query'] = query.to_jaxb_json_hash unless query.nil?
  return _h
end

#to_jsonObject

the json (string form) for this SearchResults



4180
4181
4182
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 4180

def to_json
  to_jaxb_json_hash.to_json
end