Class: Travis::Client::Namespace::Curry
- Inherits:
-
Module
- Object
- Module
- Travis::Client::Namespace::Curry
- Defined in:
- lib/travis/client/namespace.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #clear_cache ⇒ Object
- #clear_cache! ⇒ Object
- #current ⇒ Object
- #find_many(params = {}) ⇒ Object (also: #find_all)
- #find_one(id = nil) ⇒ Object (also: #find)
-
#initialize(namespace, type) ⇒ Curry
constructor
A new instance of Curry.
Constructor Details
#initialize(namespace, type) ⇒ Curry
Returns a new instance of Curry.
11 12 13 14 |
# File 'lib/travis/client/namespace.rb', line 11 def initialize(namespace, type) @namespace = namespace @type = type end |
Instance Attribute Details
#namespace ⇒ Object
Returns the value of attribute namespace.
9 10 11 |
# File 'lib/travis/client/namespace.rb', line 9 def namespace @namespace end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/travis/client/namespace.rb', line 9 def type @type end |
Instance Method Details
#clear_cache ⇒ Object
37 38 39 |
# File 'lib/travis/client/namespace.rb', line 37 def clear_cache session.clear_cache end |
#clear_cache! ⇒ Object
41 42 43 |
# File 'lib/travis/client/namespace.rb', line 41 def clear_cache! session.clear_cache! end |
#current ⇒ Object
22 23 24 25 26 |
# File 'lib/travis/client/namespace.rb', line 22 def current result = session.find_one_or_many(type) Array(result).each { |e| e.curry = self } result end |
#find_many(params = {}) ⇒ Object Also known as: find_all
28 29 30 31 32 |
# File 'lib/travis/client/namespace.rb', line 28 def find_many(params = {}) session.find_many(type, params).each do |entity| entity.curry = self end end |
#find_one(id = nil) ⇒ Object Also known as: find
16 17 18 19 20 |
# File 'lib/travis/client/namespace.rb', line 16 def find_one(id = nil) result = session.find_one(type, id) result.curry = self result end |