Class: AstroInsight::Client
- Inherits:
-
Object
- Object
- AstroInsight::Client
- Defined in:
- lib/astroinsight/client.rb
Instance Attribute Summary collapse
-
#chinese ⇒ Object
readonly
Returns the value of attribute chinese.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#geo ⇒ Object
readonly
Returns the value of attribute geo.
-
#horoscope ⇒ Object
readonly
Returns the value of attribute horoscope.
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
-
#tarot ⇒ Object
readonly
Returns the value of attribute tarot.
-
#vedic ⇒ Object
readonly
Returns the value of attribute vedic.
-
#western ⇒ Object
readonly
Returns the value of attribute western.
Instance Method Summary collapse
-
#initialize(client_id: nil, client_secret: nil, base_url: nil, language: "en", ayanamsha: "lahiri", timeout: 30) ⇒ Client
constructor
A new instance of Client.
- #set_ayanamsha(ayanamsha) ⇒ Object
- #set_language(language) ⇒ Object
Constructor Details
#initialize(client_id: nil, client_secret: nil, base_url: nil, language: "en", ayanamsha: "lahiri", timeout: 30) ⇒ Client
Returns a new instance of Client.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/astroinsight/client.rb', line 16 def initialize(client_id: nil, client_secret: nil, base_url: nil, language: "en", ayanamsha: "lahiri", timeout: 30) @config = Configuration.new( client_id: client_id, client_secret: client_secret, base_url: base_url, language: language, ayanamsha: ayanamsha, timeout: timeout ) @http_client = HttpClient.new(@config) @vedic = Services::VedicContainer.new(@http_client) @western = Services::WesternContainer.new(@http_client) @horoscope = Services::HoroscopeService.new(@http_client) @tarot = Services::TarotService.new(@http_client) @chinese = Services::ChineseAstrologyService.new(@http_client) @geo = Services::GeoService.new(@http_client) end |
Instance Attribute Details
#chinese ⇒ Object (readonly)
Returns the value of attribute chinese.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def chinese @chinese end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def config @config end |
#geo ⇒ Object (readonly)
Returns the value of attribute geo.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def geo @geo end |
#horoscope ⇒ Object (readonly)
Returns the value of attribute horoscope.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def horoscope @horoscope end |
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def http_client @http_client end |
#tarot ⇒ Object (readonly)
Returns the value of attribute tarot.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def tarot @tarot end |
#vedic ⇒ Object (readonly)
Returns the value of attribute vedic.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def vedic @vedic end |
#western ⇒ Object (readonly)
Returns the value of attribute western.
14 15 16 |
# File 'lib/astroinsight/client.rb', line 14 def western @western end |
Instance Method Details
#set_ayanamsha(ayanamsha) ⇒ Object
41 42 43 44 |
# File 'lib/astroinsight/client.rb', line 41 def set_ayanamsha(ayanamsha) @config.ayanamsha = ayanamsha self end |
#set_language(language) ⇒ Object
36 37 38 39 |
# File 'lib/astroinsight/client.rb', line 36 def set_language(language) @config.language = language self end |