Module: Fuselage

Defined in:
lib/fuselage.rb,
lib/fuselage/api.rb,
lib/fuselage/tag.rb,
lib/fuselage/base.rb,
lib/fuselage/blob.rb,
lib/fuselage/tree.rb,
lib/fuselage/user.rb,
lib/fuselage/error.rb,
lib/fuselage/commit.rb,
lib/fuselage/version.rb,
lib/fuselage/reference.rb,
lib/fuselage/repository.rb

Overview

Include this into your app so you can access the child classes easier. This is the root of all things Fulelage.

Defined Under Namespace

Classes: APIError, AnonymousApi, Api, ArgumentMustBeHash, AuthApi, AuthenticationRequired, Base, Blob, Commit, FormatError, InvalidLogin, NotFound, Reference, RegisterError, Repository, Tag, Tree, User

Constant Summary collapse

VERSION =
"0.0.4"

Instance Method Summary collapse

Instance Method Details

#authenticated(token, &block) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fuselage.rb', line 18

def authenticated(token, &block)
  begin
    Api.api = AuthApi.instance
    Api.api.token = token
    Api.authenticated = true
    yield
  ensure
    # Reset authenticated so if we were to do an anonymous call it would Just Work(tm)
    Api.authenticated = false
    Api.api = AnonymousApi.instance
  end
end