Class: Zensana::Zendesk::Comment
- Inherits:
-
Object
- Object
- Zensana::Zendesk::Comment
- Includes:
- Validate::Key
- Defined in:
- lib/zensana/models/zendesk/comment.rb
Constant Summary collapse
- REQUIRED_KEYS =
[ :author_id, :value ]
- OPTIONAL_KEYS =
[ :created_at, :public, :uploads ]
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Class validates the comment attributes added during the Ticket Import call.
Instance Method Summary collapse
- #author_exists?(id) ⇒ Boolean
-
#initialize(attributes) ⇒ Comment
constructor
A new instance of Comment.
- #method_missing(name, *args, &block) ⇒ Object
Methods included from Validate::Key
#has_required_keys?, #has_unknown_keys?, #optional_keys, #required_keys, #valid_keys, #validate_keys
Constructor Details
#initialize(attributes) ⇒ Comment
Returns a new instance of Comment.
16 17 18 19 |
# File 'lib/zensana/models/zendesk/comment.rb', line 16 def initialize(attributes) validate_keys attributes @attributes = attributes end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
27 28 29 |
# File 'lib/zensana/models/zendesk/comment.rb', line 27 def method_missing(name, *args, &block) attributes[name.to_s] || super end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Class validates the comment attributes added during the Ticket Import call. Comments cannot be created this way for existing tickets.
14 15 16 |
# File 'lib/zensana/models/zendesk/comment.rb', line 14 def attributes @attributes end |