Ruby: place properties on separate lines with description

This commit is contained in:
xhh 2015-12-12 21:33:32 +08:00
parent 79033e57fe
commit ddc4b0a548
6 changed files with 51 additions and 12 deletions

View File

@ -1,13 +1,14 @@
module {{moduleName}}{{#models}}{{#model}}{{#description}}
# {{{description}}}{{/description}}
class {{classname}} < BaseObject
attr_accessor {{#vars}}:{{{name}}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{newline}}
class {{classname}} < BaseObject{{#vars}}{{#description}}
# {{{description}}}{{/description}}
attr_accessor :{{{name}}}
{{/vars}}
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
{{#vars}}{{#description}}
# {{{description}}}{{/description}}
{{#vars}}
:'{{{name}}}' => :'{{{baseName}}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
}

View File

@ -1,6 +1,8 @@
module Petstore
class Category < BaseObject
attr_accessor :id, :name
attr_accessor :id
attr_accessor :name
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map

View File

@ -1,6 +1,17 @@
module Petstore
class Order < BaseObject
attr_accessor :id, :pet_id, :quantity, :ship_date, :status, :complete
attr_accessor :id
attr_accessor :pet_id
attr_accessor :quantity
attr_accessor :ship_date
# Order Status
attr_accessor :status
attr_accessor :complete
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
@ -14,7 +25,6 @@ module Petstore
:'ship_date' => :'shipDate',
# Order Status
:'status' => :'status',
:'complete' => :'complete'

View File

@ -1,6 +1,17 @@
module Petstore
class Pet < BaseObject
attr_accessor :id, :category, :name, :photo_urls, :tags, :status
attr_accessor :id
attr_accessor :category
attr_accessor :name
attr_accessor :photo_urls
attr_accessor :tags
# pet status in the store
attr_accessor :status
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
@ -16,7 +27,6 @@ module Petstore
:'tags' => :'tags',
# pet status in the store
:'status' => :'status'
}

View File

@ -1,6 +1,8 @@
module Petstore
class Tag < BaseObject
attr_accessor :id, :name
attr_accessor :id
attr_accessor :name
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map

View File

@ -1,6 +1,21 @@
module Petstore
class User < BaseObject
attr_accessor :id, :username, :first_name, :last_name, :email, :password, :phone, :user_status
attr_accessor :id
attr_accessor :username
attr_accessor :first_name
attr_accessor :last_name
attr_accessor :email
attr_accessor :password
attr_accessor :phone
# User Status
attr_accessor :user_status
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
@ -20,7 +35,6 @@ module Petstore
:'phone' => :'phone',
# User Status
:'user_status' => :'userStatus'
}