Class: Astroapi::Categories::InsightsCategory

Inherits:
BaseCategory
  • Object
show all
Defined in:
lib/astroapi/categories/insights.rb

Overview

Insights category client with specialized sub-clients

Instance Attribute Summary collapse

Attributes inherited from BaseCategory

#http

Instance Method Summary collapse

Constructor Details

#initialize(http_client) ⇒ InsightsCategory

Returns a new instance of InsightsCategory.



16
17
18
19
20
21
22
23
24
25
# File 'lib/astroapi/categories/insights.rb', line 16

def initialize(http_client)
  super(http_client)

  # Initialize sub-clients
  @relationship = Insights::Relationship.new(http_client)
  @pet = Insights::Pet.new(http_client)
  @wellness = Insights::Wellness.new(http_client)
  @financial = Insights::Financial.new(http_client)
  @business = Insights::Business.new(http_client)
end

Instance Attribute Details

#businessObject (readonly)

Returns the value of attribute business.



14
15
16
# File 'lib/astroapi/categories/insights.rb', line 14

def business
  @business
end

#financialObject (readonly)

Returns the value of attribute financial.



14
15
16
# File 'lib/astroapi/categories/insights.rb', line 14

def financial
  @financial
end

#petObject (readonly)

Returns the value of attribute pet.



14
15
16
# File 'lib/astroapi/categories/insights.rb', line 14

def pet
  @pet
end

#relationshipObject (readonly)

Returns the value of attribute relationship.



14
15
16
# File 'lib/astroapi/categories/insights.rb', line 14

def relationship
  @relationship
end

#wellnessObject (readonly)

Returns the value of attribute wellness.



14
15
16
# File 'lib/astroapi/categories/insights.rb', line 14

def wellness
  @wellness
end

Instance Method Details

#discover(params = {}) ⇒ Hash

Discover available insights

Parameters:

  • params (Hash) (defaults to: {})

    Query parameters

Returns:

  • (Hash)

    List of available insights



30
31
32
# File 'lib/astroapi/categories/insights.rb', line 30

def discover(params = {})
  http.get(build_url, params: params)
end