Sha256: dfbe874cdaa0dc8bbf67e1f70169a2eb889957031e6d64e8b1b982546f360f9f
Contents?: true
Size: 719 Bytes
Versions: 10
Compression:
Stored size: 719 Bytes
Contents
module Kong module BelongsToConsumer attr_accessor :consumer # Convert API end point relative to Kong Consumer resource def use_consumer_end_point self.api_end_point = "/consumers/#{self.consumer_id}#{self.class::API_END_POINT}" if self.consumer_id end # Get Consumer resource # @return [Kong::Consumer] def consumer @consumer ||= Consumer.find(self.consumer_id) end # Set Consumer resource # @param [Kong::Consumer] consumer def consumer=(consumer) @consumer = consumer self.consumer_id = consumer.id end # Set Consumer id # @param [String] id def consumer_id=(id) super(id) use_consumer_end_point end end end
Version data entries
10 entries across 10 versions & 2 rubygems