Module: Kong::BelongsToConsumer
- Defined in:
- lib/kong/belongs_to_consumer.rb
Instance Attribute Summary collapse
-
#consumer ⇒ Kong::Consumer
Get Consumer resource.
Instance Method Summary collapse
-
#consumer_id=(id) ⇒ Object
Set Consumer id.
-
#use_consumer_end_point ⇒ Object
Convert API end point relative to Kong Consumer resource.
Instance Attribute Details
#consumer ⇒ Kong::Consumer
Get Consumer resource
12 13 14 |
# File 'lib/kong/belongs_to_consumer.rb', line 12 def consumer @consumer end |
Instance Method Details
#consumer_id=(id) ⇒ Object
Set Consumer id
25 26 27 28 |
# File 'lib/kong/belongs_to_consumer.rb', line 25 def consumer_id=(id) super(id) use_consumer_end_point end |
#use_consumer_end_point ⇒ Object
Convert API end point relative to Kong Consumer resource
6 7 8 |
# File 'lib/kong/belongs_to_consumer.rb', line 6 def use_consumer_end_point self.api_end_point = "/consumers/#{self.consumer_id}#{self.class::API_END_POINT}" if self.consumer_id end |