Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/gorse.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(user_id:, labels: nil, comment: nil) ⇒ User
constructor
A new instance of User.
- #to_h ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(user_id:, labels: nil, comment: nil) ⇒ User
Returns a new instance of User.
55 56 57 58 59 |
# File 'lib/gorse.rb', line 55 def initialize(user_id:, labels: nil, comment: nil) @user_id = user_id @labels = labels @comment = comment end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
74 75 76 |
# File 'lib/gorse.rb', line 74 def comment @comment end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
74 75 76 |
# File 'lib/gorse.rb', line 74 def labels @labels end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
74 75 76 |
# File 'lib/gorse.rb', line 74 def user_id @user_id end |
Class Method Details
Instance Method Details
#to_h ⇒ Object
61 62 63 |
# File 'lib/gorse.rb', line 61 def to_h { 'UserId' => @user_id, 'Labels' => @labels, 'Comment' => @comment } end |
#to_json(*_args) ⇒ Object
65 66 67 |
# File 'lib/gorse.rb', line 65 def to_json(*_args) JSON.generate(to_h) end |