class Ari::Generators::Property

Public Class Methods

new(name, specification) click to toggle source
# File lib/ari/generators/property.rb, line 5
def initialize(name, specification)
  @name = name
  @specification = specification
end

Public Instance Methods

description() click to toggle source
# File lib/ari/generators/property.rb, line 30
def description
  @specification['description']
end
is_a_list?() click to toggle source
# File lib/ari/generators/property.rb, line 26
def is_a_list?
  @specification['type'].start_with?('List[')
end
name() click to toggle source
# File lib/ari/generators/property.rb, line 10
def name
  @name
end
required?() click to toggle source
# File lib/ari/generators/property.rb, line 14
def required?
  @specification['required']
end
type() click to toggle source
# File lib/ari/generators/property.rb, line 18
def type
  if is_a_list?
    @specification['type'][5..-2]
  else
    @specification['type'] == 'void' ? nil : @specification['type']
  end
end