Class: GSONClassGenerator::OutputOptions
- Inherits:
-
Object
- Object
- GSONClassGenerator::OutputOptions
- Defined in:
- lib/gson-class-generator.rb
Instance Method Summary collapse
- #boxed_primatives? ⇒ Boolean
- #field_constructor? ⇒ Boolean
- #final_fields? ⇒ Boolean
- #getters? ⇒ Boolean
-
#initialize(opts) ⇒ OutputOptions
constructor
A new instance of OutputOptions.
- #setters? ⇒ Boolean
Constructor Details
#initialize(opts) ⇒ OutputOptions
Returns a new instance of OutputOptions.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/gson-class-generator.rb', line 48 def initialize(opts) @getters = opts.fetch("getters".to_sym, false) === true @setters = opts.fetch("setters".to_sym, false) === true @final_fields = opts.fetch("final_fields".to_sym, false) === true @field_constructor = opts.fetch("field_constructor".to_sym, false) === true @boxed_primatives = opts.fetch("boxed_primatives".to_sym, false) === true # Can't have setters for final fields @setters = false if @final_fields end |
Instance Method Details
#boxed_primatives? ⇒ Boolean
75 76 77 |
# File 'lib/gson-class-generator.rb', line 75 def boxed_primatives? @boxed_primatives end |
#field_constructor? ⇒ Boolean
71 72 73 |
# File 'lib/gson-class-generator.rb', line 71 def field_constructor? @field_constructor end |
#final_fields? ⇒ Boolean
67 68 69 |
# File 'lib/gson-class-generator.rb', line 67 def final_fields? @final_fields end |
#getters? ⇒ Boolean
59 60 61 |
# File 'lib/gson-class-generator.rb', line 59 def getters? @getters end |
#setters? ⇒ Boolean
63 64 65 |
# File 'lib/gson-class-generator.rb', line 63 def setters? @setters end |