Class: ItemPatch
- Inherits:
-
Object
- Object
- ItemPatch
- Defined in:
- lib/gorse.rb
Instance Method Summary collapse
-
#initialize(is_hidden: nil, categories: nil, timestamp: nil, labels: nil, comment: nil) ⇒ ItemPatch
constructor
A new instance of ItemPatch.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(is_hidden: nil, categories: nil, timestamp: nil, labels: nil, comment: nil) ⇒ ItemPatch
Returns a new instance of ItemPatch.
146 147 148 149 150 151 152 |
# File 'lib/gorse.rb', line 146 def initialize(is_hidden: nil, categories: nil, timestamp: nil, labels: nil, comment: nil) @is_hidden = is_hidden @categories = categories @timestamp = @labels = labels @comment = comment end |
Instance Method Details
#to_json(*_args) ⇒ Object
154 155 156 157 158 159 160 161 162 |
# File 'lib/gorse.rb', line 154 def to_json(*_args) data = {} data['IsHidden'] = @is_hidden unless @is_hidden.nil? data['Categories'] = @categories unless @categories.nil? data['Timestamp'] = @timestamp unless @timestamp.nil? data['Labels'] = @labels unless @labels.nil? data['Comment'] = @comment unless @comment.nil? JSON.generate(data) end |