Class: Ebay::Schema::ClassDefinition

Inherits:
Object
  • Object
show all
Includes:
Inflections, RubyClassGeneratorHelper
Defined in:
lib/ebay/schema/mapper/class_definition.rb

Constant Summary

Constant Summary

Constants included from Inflections

Inflections::DOWNCASE_TOKENS, Inflections::NAME_MAPPINGS, Inflections::UPCASE_TOKENS

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Inflections

#downcase_first_character, #ebay_camelize, #ebay_underscore, #underscore, #upcase_first_character

Constructor Details

- (ClassDefinition) initialize(class_name, element_name, module_name, superclass_name = nil)



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

- (Object) class_name

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

- (Object) documentation

Returns the value of attribute documentation



7
8
9
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7

def documentation
  @documentation
end

- (Object) element_name

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

- (Object) module_name

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

- (Object) nodes

Returns the value of attribute nodes



7
8
9
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7

def nodes
  @nodes
end

- (Object) requires

Returns the value of attribute requires



7
8
9
# File 'lib/ebay/schema/mapper/class_definition.rb', line 7

def requires
  @requires
end

- (Object) superclass_name

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

- (Object) class_definition



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

- (Object) customization



44
45
46
# File 'lib/ebay/schema/mapper/class_definition.rb', line 44

def customization
  @customization ||= ''
end

- (Object) customization=(value)



40
41
42
# File 'lib/ebay/schema/mapper/class_definition.rb', line 40

def customization=(value)
  @customization = value
end