diff options
author | Valery Sizov <valery@gitlab.com> | 2016-06-23 09:35:51 +0000 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-06-23 09:35:51 +0000 |
commit | f2325a45c1ce4e6685f61a6e5d1ef0f351e34a18 (patch) | |
tree | c8aae6ffcab759a07102913bfafa705d62fba223 /lib | |
parent | f9e59b36016c3d696b4e798c0642874e2f8f76ec (diff) | |
parent | 2467697d81e4ab9e9d770d55d8cb33cb5779db22 (diff) | |
download | gitlab-shell-f2325a45c1ce4e6685f61a6e5d1ef0f351e34a18.tar.gz |
Merge branch 'simplify-access-status' into 'master'
Simplify the GitAccessStatus class
Make the optional 'message' argument required. Remove unused 'to_json'
method.
See merge request !65
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_access_status.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/gitlab_access_status.rb b/lib/gitlab_access_status.rb index 14ec1ef..7a5f7d5 100644 --- a/lib/gitlab_access_status.rb +++ b/lib/gitlab_access_status.rb @@ -1,10 +1,9 @@ require 'json' class GitAccessStatus - attr_accessor :status, :message - alias_method :allowed?, :status + attr_reader :message - def initialize(status, message = '') + def initialize(status, message) @status = status @message = message end @@ -14,7 +13,7 @@ class GitAccessStatus self.new(values["status"], values["message"]) end - def to_json - { status: @status, message: @message }.to_json + def allowed? + @status end end |