Class: Senju::Gitlab
- Inherits:
-
Object
- Object
- Senju::Gitlab
- Defined in:
- lib/senju/gitlab.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(access_token_or_hash) ⇒ Gitlab
constructor
A new instance of Gitlab.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(access_token_or_hash) ⇒ Gitlab
Returns a new instance of Gitlab.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/senju/gitlab.rb', line 5 def initialize(access_token_or_hash) if access_token_or_hash.is_a? Hash = access_token_or_hash endpoint ||= "https://#{["host"]}/api/v4" @client = Gitlab.client(endpoint: endpoint, private_token: ["token"]) else endpoint ||= "https://gitlab.com/api/v4" @client = Gitlab.client(endpoint: endpoint, private_token: access_token) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
16 17 18 |
# File 'lib/senju/gitlab.rb', line 16 def method_missing(method, *args, &block) client.send(method, *args, &block) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/senju/gitlab.rb', line 3 def client @client end |