Class: Mashery::Key
- Inherits:
-
ApiObjectBase
- Object
- ApiObjectBase
- Mashery::Key
- Defined in:
- lib/mashery/key.rb
Instance Attribute Summary collapse
-
#apikey ⇒ Object
Returns the value of attribute apikey.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#limits ⇒ Object
readonly
Returns the value of attribute limits.
-
#qps_limit_ceiling ⇒ Object
Returns the value of attribute qps_limit_ceiling.
-
#qps_limit_exempt ⇒ Object
Returns the value of attribute qps_limit_exempt.
-
#rate_limit_ceiling ⇒ Object
Returns the value of attribute rate_limit_ceiling.
-
#rate_limit_exempt ⇒ Object
Returns the value of attribute rate_limit_exempt.
-
#required_referer ⇒ Object
Returns the value of attribute required_referer.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#service_key ⇒ Object
readonly
Returns the value of attribute service_key.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Key
constructor
A new instance of Key.
Methods inherited from ApiObjectBase
Constructor Details
#initialize(data) ⇒ Key
Returns a new instance of Key.
13 14 15 16 17 |
# File 'lib/mashery/key.rb', line 13 def initialize(data) limits = data.delete('limits') @limits = limits.map {|l| Limit.new(l['period'], l['source'], l['ceiling'])} if limits super end |
Instance Attribute Details
#apikey ⇒ Object
Returns the value of attribute apikey.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def apikey @apikey end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
3 4 5 |
# File 'lib/mashery/key.rb', line 3 def created @created end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/mashery/key.rb', line 3 def id @id end |
#limits ⇒ Object (readonly)
Returns the value of attribute limits.
3 4 5 |
# File 'lib/mashery/key.rb', line 3 def limits @limits end |
#qps_limit_ceiling ⇒ Object
Returns the value of attribute qps_limit_ceiling.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def qps_limit_ceiling @qps_limit_ceiling end |
#qps_limit_exempt ⇒ Object
Returns the value of attribute qps_limit_exempt.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def qps_limit_exempt @qps_limit_exempt end |
#rate_limit_ceiling ⇒ Object
Returns the value of attribute rate_limit_ceiling.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def rate_limit_ceiling @rate_limit_ceiling end |
#rate_limit_exempt ⇒ Object
Returns the value of attribute rate_limit_exempt.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def rate_limit_exempt @rate_limit_exempt end |
#required_referer ⇒ Object
Returns the value of attribute required_referer.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def required_referer @required_referer end |
#secret ⇒ Object
Returns the value of attribute secret.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def secret @secret end |
#service_key ⇒ Object (readonly)
Returns the value of attribute service_key.
3 4 5 |
# File 'lib/mashery/key.rb', line 3 def service_key @service_key end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/mashery/key.rb', line 4 def status @status end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
3 4 5 |
# File 'lib/mashery/key.rb', line 3 def updated @updated end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
3 4 5 |
# File 'lib/mashery/key.rb', line 3 def username @username end |
Class Method Details
.create(service_key, username, fields = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/mashery/key.rb', line 7 def self.create(service_key, username, fields = {}) fields ||= {} our_fields = fields.merge('service' => {'service_key' => service_key}, 'member' => {'username' => username}) super(our_fields) end |