Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

user commodity methods

  • Loading branch information...
commit 8c6d19049b6cc9625505ea89b85e7fd57d9f4b96 1 parent 625717d
andrea@VEGETA authored

Showing 2 changed files with 18 additions and 17 deletions. Show diff stats Hide diff stats

  1. +0 17 lib/HNAPI/domain/User.rb
  2. +18 0 lib/HNAPI/domain/user.rb
17 lib/HNAPI/domain/User.rb
... ... @@ -1,17 +0,0 @@
1   -
2   -class User
3   -
4   - def login(name, password)
5   - if LoginService.new.login(name, password)
6   - @name = name
7   - end
8   - return @name
9   - end
10   -
11   - def logout
12   - if LoginService.new.logout
13   - @name = nil
14   - end
15   - return @name == nil
16   - end
17   -end
18 lib/HNAPI/domain/user.rb
... ... @@ -0,0 +1,18 @@
  1 +
  2 +class User
  3 +
  4 + attr_reader :name
  5 +
  6 + def initialize(name)
  7 + @name = name
  8 + end
  9 +
  10 + def login(password)
  11 + return LoginService.new.login(@name, password)
  12 + end
  13 +
  14 + def logout
  15 + return LoginService.new.logout
  16 + end
  17 +
  18 +end

0 comments on commit 8c6d190

Please sign in to comment.
Something went wrong with that request. Please try again.