Class: FirmResult

Inherits:
Object
  • Object
show all
Defined in:
lib/mas/firm_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ FirmResult

Returns a new instance of FirmResult.



7
8
9
10
11
12
13
# File 'lib/mas/firm_result.rb', line 7

def initialize(data)
  source = data['_source']
  @id    = source['_id']
  @name  = source['registered_name']
  @total_advisers  = source['advisers'].count
  @closest_adviser = data['sort'].first
end

Instance Attribute Details

#closest_adviserObject (readonly)

Returns the value of attribute closest_adviser.



2
3
4
# File 'lib/mas/firm_result.rb', line 2

def closest_adviser
  @closest_adviser
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/mas/firm_result.rb', line 2

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/mas/firm_result.rb', line 2

def name
  @name
end

#total_advisersObject (readonly)

Returns the value of attribute total_advisers.



2
3
4
# File 'lib/mas/firm_result.rb', line 2

def total_advisers
  @total_advisers
end