Class: Giggly::User
- Inherits:
-
Object
- Object
- Giggly::User
- Defined in:
- lib/giggly/user.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #[](value) ⇒ Object
-
#initialize(data) ⇒ User
constructor
A new instance of User.
- #method_missing(method, *args) ⇒ Object
- #user_id ⇒ Object
Constructor Details
#initialize(data) ⇒ User
Returns a new instance of User.
6 7 8 |
# File 'lib/giggly/user.rb', line 6 def initialize(data) @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
18 19 20 21 |
# File 'lib/giggly/user.rb', line 18 def method_missing(method, *args) super unless @data[method.to_s] @data[method.to_s] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/giggly/user.rb', line 4 def data @data end |
Instance Method Details
#[](value) ⇒ Object
14 15 16 |
# File 'lib/giggly/user.rb', line 14 def [](value) @data[value.to_s] end |
#user_id ⇒ Object
10 11 12 |
# File 'lib/giggly/user.rb', line 10 def user_id @data["UID"] end |