Class: Sendly::Label
- Inherits:
-
Object
- Object
- Sendly::Label
- Defined in:
- lib/sendly/types.rb
Overview
Labels
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(data) ⇒ Label
constructor
A new instance of Label.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ Label
Returns a new instance of Label.
675 676 677 678 679 680 681 |
# File 'lib/sendly/types.rb', line 675 def initialize(data) @id = data["id"] @name = data["name"] @color = data["color"] @description = data["description"] @created_at = parse_time(data["createdAt"] || data["created_at"]) end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
673 674 675 |
# File 'lib/sendly/types.rb', line 673 def color @color end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
673 674 675 |
# File 'lib/sendly/types.rb', line 673 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
673 674 675 |
# File 'lib/sendly/types.rb', line 673 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
673 674 675 |
# File 'lib/sendly/types.rb', line 673 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
673 674 675 |
# File 'lib/sendly/types.rb', line 673 def name @name end |
Instance Method Details
#to_h ⇒ Object
683 684 685 686 687 688 |
# File 'lib/sendly/types.rb', line 683 def to_h { id: id, name: name, color: color, description: description, created_at: created_at&.iso8601 }.compact end |