Class: Ehpt::GetUserIdFromInitial
- Defined in:
- lib/ehpt/get_user_id_from_initial.rb
Constant Summary collapse
- @@memberships =
nil
Instance Attribute Summary collapse
-
#initial ⇒ Object
readonly
Returns the value of attribute initial.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(initial) ⇒ GetUserIdFromInitial
constructor
A new instance of GetUserIdFromInitial.
Methods inherited from Base
#add_error, #add_warning, call, #error?, #success?, #warning?
Constructor Details
#initialize(initial) ⇒ GetUserIdFromInitial
Returns a new instance of GetUserIdFromInitial.
15 16 17 18 |
# File 'lib/ehpt/get_user_id_from_initial.rb', line 15 def initialize(initial) @initial = initial super end |
Instance Attribute Details
#initial ⇒ Object (readonly)
Returns the value of attribute initial.
5 6 7 |
# File 'lib/ehpt/get_user_id_from_initial.rb', line 5 def initial @initial end |
Class Method Details
.memberships ⇒ Object
7 8 9 |
# File 'lib/ehpt/get_user_id_from_initial.rb', line 7 def self.memberships @@memberships end |
.memberships=(memberships) ⇒ Object
11 12 13 |
# File 'lib/ehpt/get_user_id_from_initial.rb', line 11 def self.memberships=(memberships) @@memberships = memberships end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ehpt/get_user_id_from_initial.rb', line 20 def call fetch_memberships_from_pt! if user.nil? add_error("Not found any user with initial #{initial}") else @data = user.id end rescue StandardError => e add_error(eval(e.)[:body]) end |