Class: Reactio::APIEndpoint
- Inherits:
-
Object
- Object
- Reactio::APIEndpoint
- Defined in:
- lib/reactio/api_endpoint.rb
Constant Summary collapse
- DOMAIN =
'reactio.jp'.freeze
Instance Attribute Summary collapse
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #base_url ⇒ Object
-
#initialize(organization) ⇒ APIEndpoint
constructor
A new instance of APIEndpoint.
Constructor Details
#initialize(organization) ⇒ APIEndpoint
Returns a new instance of APIEndpoint.
9 10 11 12 |
# File 'lib/reactio/api_endpoint.rb', line 9 def initialize(organization) @organization = organization @base_url = URI::HTTPS.build(host: "#{organization}.#{DOMAIN}") end |
Instance Attribute Details
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
7 8 9 |
# File 'lib/reactio/api_endpoint.rb', line 7 def organization @organization end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 |
# File 'lib/reactio/api_endpoint.rb', line 18 def ==(other) other.instance_of?(self.class) && self.organization == other.organization end |
#base_url ⇒ Object
14 15 16 |
# File 'lib/reactio/api_endpoint.rb', line 14 def base_url @base_url.to_s end |