Class: GSONClassGenerator::OutputOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/gson-class-generator.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


75
76
77
# File 'lib/gson-class-generator.rb', line 75

def boxed_primatives?
	@boxed_primatives
end

#field_constructor?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/gson-class-generator.rb', line 71

def field_constructor?
	@field_constructor
end

#final_fields?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/gson-class-generator.rb', line 67

def final_fields?
	@final_fields
end

#getters?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/gson-class-generator.rb', line 59

def getters?
	@getters
end

#setters?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/gson-class-generator.rb', line 63

def setters?
	@setters
end