Skip to content

Commit

Permalink
format enums a little nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf committed Sep 18, 2014
1 parent f3af0f3 commit 280df62
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Expand Up @@ -127,10 +127,22 @@ These fields will always be treated as a plain javascript boolean (i.e. `true` o

Several messages accept an enum field. RiakPBC exports these as variables on the main object to simplify input. They are as follows:

- IndexQueryType: RiakPBC.IndexType.Exact, RiakPBC.IndexType.Range
- DataType: RiakPBC.DataType.Counter, RiakPBC.DataType.Set, RiakPBC.DataType.Map
- MapFieldType: RiakPBC.FieldType.Counter, RiakPBC.FieldType.Set, RiakPBC.FieldType.Register, RiakPBC.FieldType.Flag, RiakPBC.FieldType.Map
- FlagOp: RiakPBC.Flag.Enable, RiakPBC.Flag.Disable
- IndexQueryType:
- RiakPBC.IndexType.Exact
- RiakPBC.IndexType.Range
- DataType:
- RiakPBC.DataType.Counter
- RiakPBC.DataType.Set
- RiakPBC.DataType.Map
- MapFieldType:
- RiakPBC.FieldType.Counter
- RiakPBC.FieldType.Set
- RiakPBC.FieldType.Register
- RiakPBC.FieldType.Flag
- RiakPBC.FieldType.Map
- FlagOp:
- RiakPBC.Flag.Enable
- RiakPBC.Flag.Disable

These variables are all simple numbers, however, so when RiakPBC returns a message containing one of these types you will receive a plain number. I would recommend using the exported variables for comparison purposes to maintain readable code.

Expand Down

0 comments on commit 280df62

Please sign in to comment.