Class: EbayTrading::Schema::ObjectNode

Inherits:
Node
  • Object
show all
Defined in:
lib/ebay_trading/schema/mapper/node.rb

Constant Summary

Constants included from Inflections

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

Instance Attribute Summary

Attributes inherited from Node

#max, #min, #name

Instance Method Summary collapse

Methods inherited from Node

#accessor_name, #declaration, #initialize, #optional?, #xml_mapping_node_type

Methods included from Inflections

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

Constructor Details

This class inherits a constructor from EbayTrading::Schema::Node

Instance Method Details

#class_nameObject



137
138
139
# File 'lib/ebay_trading/schema/mapper/node.rb', line 137

def class_name
  clean_class_name(@type)
end

#to_sObject



141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/ebay_trading/schema/mapper/node.rb', line 141

def to_s
  result = "#{declaration}, '#{@name}', :class => #{class_name}"
  result << ', :optional => true' if optional?
  if @name == 'Type'
    result += "\ndef type\n  @type.code\nend\n    ENDMETHOD\n  end\n  result\nend\n"