Class: Eisenhower::Staff
- Inherits:
-
Object
- Object
- Eisenhower::Staff
- Defined in:
- lib/eisenhower/staff.rb
Instance Attribute Summary collapse
-
#admin ⇒ Object
Returns the value of attribute admin.
-
#email ⇒ Object
Returns the value of attribute email.
-
#full_name ⇒ Object
(also: #name)
Returns the value of attribute full_name.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #admin? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Staff
constructor
A new instance of Staff.
Constructor Details
#initialize(attributes = {}) ⇒ Staff
Returns a new instance of Staff.
6 7 8 |
# File 'lib/eisenhower/staff.rb', line 6 def initialize(attributes={}) attributes.each { |key, val| send("#{key}=", val) if respond_to?("#{key}=") } end |
Instance Attribute Details
#admin ⇒ Object
Returns the value of attribute admin.
3 4 5 |
# File 'lib/eisenhower/staff.rb', line 3 def admin @admin end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/eisenhower/staff.rb', line 3 def email @email end |
#full_name ⇒ Object Also known as: name
Returns the value of attribute full_name.
3 4 5 |
# File 'lib/eisenhower/staff.rb', line 3 def full_name @full_name end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/eisenhower/staff.rb', line 3 def id @id end |
Class Method Details
.find(staff_id) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/eisenhower/staff.rb', line 15 def find(staff_id) body = Eisenhower::Client.get_and_parse("/staff/get/id/#{staff_id}") Eisenhower::Staff.new({ :id => body["_id"], :full_name => body["fullName"], :email => body["email"], :admin => body["admin"] }) end |
Instance Method Details
#admin? ⇒ Boolean
10 11 12 |
# File 'lib/eisenhower/staff.rb', line 10 def admin? @admin end |