Class: Ebay::Schema::ClassDefinition
- Inherits:
-
Object
- Object
- Ebay::Schema::ClassDefinition
- Includes:
- Inflections, RubyClassGeneratorHelper
- Defined in:
- lib/ebay/schema/mapper/class_definition.rb
Constant Summary
Constants included from Inflections
Inflections::DOWNCASE_TOKENS, Inflections::NAME_MAPPINGS, Inflections::UPCASE_TOKENS
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#documentation ⇒ Object
Returns the value of attribute documentation.
-
#element_name ⇒ Object
Returns the value of attribute element_name.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
-
#nodes ⇒ Object
Returns the value of attribute nodes.
-
#requires ⇒ Object
Returns the value of attribute requires.
-
#superclass_name ⇒ Object
Returns the value of attribute superclass_name.
Instance Method Summary collapse
- #class_definition ⇒ Object
- #customization ⇒ Object
- #customization=(value) ⇒ Object
-
#initialize(class_name, element_name, module_name, superclass_name = nil) ⇒ ClassDefinition
constructor
A new instance of ClassDefinition.
Methods included from Inflections
#downcase_first_character, #ebay_camelize, #ebay_underscore, #underscore, #upcase_first_character
Constructor Details
#initialize(class_name, element_name, module_name, superclass_name = nil) ⇒ ClassDefinition
Returns a new instance of ClassDefinition.
9 10 11 12 13 14 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 9 def initialize(class_name, element_name, module_name, superclass_name = nil) @class_name, @module_name = class_name, module_name @element_name = element_name @superclass_name = superclass_name.gsub(/(Request|Response)$/, '') unless superclass_name.nil? @documentation = '' end |
Instance Attribute Details
#class_name ⇒ Object
Returns the value of attribute class_name.
7 8 9 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7 def class_name @class_name end |
#documentation ⇒ Object
Returns the value of attribute documentation.
7 8 9 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7 def documentation @documentation end |
#element_name ⇒ Object
Returns the value of attribute element_name.
7 8 9 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7 def element_name @element_name end |
#module_name ⇒ Object
Returns the value of attribute module_name.
7 8 9 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7 def module_name @module_name end |
#nodes ⇒ Object
Returns the value of attribute nodes.
7 8 9 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7 def nodes @nodes end |
#requires ⇒ Object
Returns the value of attribute requires.
7 8 9 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7 def requires @requires end |
#superclass_name ⇒ Object
Returns the value of attribute superclass_name.
7 8 9 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7 def superclass_name @superclass_name end |
Instance Method Details
#class_definition ⇒ Object
34 35 36 37 38 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 34 def class_definition result = @class_name.dup result << " < #{@superclass_name}" unless @superclass_name.nil? result end |
#customization ⇒ Object
44 45 46 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 44 def customization @customization ||= '' end |
#customization=(value) ⇒ Object
40 41 42 |
# File 'lib/ebay/schema/mapper/class_definition.rb', line 40 def customization=(value) @customization = value end |