Class: GoonModelGen::Converter::Mapping
- Inherits:
-
Object
- Object
- GoonModelGen::Converter::Mapping
- Defined in:
- lib/goon_model_gen/converter/mapping.rb
Instance Attribute Summary collapse
-
#allow_zero ⇒ Object
for int or uint only.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#func ⇒ Object
readonly
Returns the value of attribute func.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#package_base_path ⇒ Object
Returns the value of attribute package_base_path.
-
#package_name ⇒ Object
Returns the value of attribute package_name.
-
#requires_context ⇒ Object
readonly
Returns the value of attribute requires_context.
-
#returns_error ⇒ Object
readonly
Returns the value of attribute returns_error.
Instance Method Summary collapse
-
#initialize(name, args, func, requires_context, returns_error) ⇒ Mapping
constructor
A new instance of Mapping.
- #resolve_package_path(config) ⇒ Object
Constructor Details
#initialize(name, args, func, requires_context, returns_error) ⇒ Mapping
Returns a new instance of Mapping.
9 10 11 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 9 def initialize(name, args, func, requires_context, returns_error) @name, @args, @func, @requires_context, @returns_error = name, args, func, requires_context, returns_error end |
Instance Attribute Details
#allow_zero ⇒ Object
for int or uint only
8 9 10 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 8 def allow_zero @allow_zero end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
6 7 8 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 6 def args @args end |
#func ⇒ Object (readonly)
Returns the value of attribute func.
6 7 8 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 6 def func @func end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 6 def name @name end |
#package_base_path ⇒ Object
Returns the value of attribute package_base_path.
7 8 9 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 7 def package_base_path @package_base_path end |
#package_name ⇒ Object
Returns the value of attribute package_name.
7 8 9 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 7 def package_name @package_name end |
#requires_context ⇒ Object (readonly)
Returns the value of attribute requires_context.
6 7 8 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 6 def requires_context @requires_context end |
#returns_error ⇒ Object (readonly)
Returns the value of attribute returns_error.
6 7 8 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 6 def returns_error @returns_error end |
Instance Method Details
#resolve_package_path(config) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/goon_model_gen/converter/mapping.rb', line 13 def resolve_package_path(config) if func.present? && func.include?('.') self.package_base_path = requires_context ? config.store_package_path : config.model_package_path self.package_name = func.split('.', 2).first end end |