Class: Parse::Decrement
- Inherits:
-
Object
- Object
- Parse::Decrement
- Defined in:
- lib/parse/datatypes.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
‘{“score”: {“__op”: “Decrement”, “amount”: 1 } }’.
Instance Method Summary collapse
-
#initialize(amount) ⇒ Decrement
constructor
A new instance of Decrement.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(amount) ⇒ Decrement
Returns a new instance of Decrement.
97 98 99 |
# File 'lib/parse/datatypes.rb', line 97 def initialize(amount) @amount = amount end |
Instance Attribute Details
#amount ⇒ Object
‘{“score”: {“__op”: “Decrement”, “amount”: 1 } }’
95 96 97 |
# File 'lib/parse/datatypes.rb', line 95 def amount @amount end |
Instance Method Details
#to_json(*a) ⇒ Object
101 102 103 104 105 106 |
# File 'lib/parse/datatypes.rb', line 101 def to_json(*a) { Protocol::KEY_OP => Protocol::KEY_DECREMENT, Protocol::KEY_AMOUNT => @amount }.to_json(*a) end |