Class: Tarantool::Generators::ModelGenerator::Field

Inherits:
Data
  • Object
show all
Defined in:
tarantool-rails/lib/generators/tarantool/model/model_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attribute_type ⇒ Object (readonly)

Returns the value of attribute attribute_type

Returns:

  • (Object) —

    the current value of attribute_type



10
11
12
# File 'tarantool-rails/lib/generators/tarantool/model/model_generator.rb', line 10

def attribute_type
  @attribute_type
end

#field_type ⇒ Object (readonly)

Returns the value of attribute field_type

Returns:

  • (Object) —

    the current value of field_type



10
11
12
# File 'tarantool-rails/lib/generators/tarantool/model/model_generator.rb', line 10

def field_type
  @field_type
end

#name ⇒ Object (readonly)

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



10
11
12
# File 'tarantool-rails/lib/generators/tarantool/model/model_generator.rb', line 10

def name
  @name
end

#nullable ⇒ Object (readonly)

Returns the value of attribute nullable

Returns:

  • (Object) —

    the current value of nullable



10
11
12
# File 'tarantool-rails/lib/generators/tarantool/model/model_generator.rb', line 10

def nullable
  @nullable
end

Instance Method Details

#declaration ⇒ Object



11
12
13
# File 'tarantool-rails/lib/generators/tarantool/model/model_generator.rb', line 11

def declaration
  "{ name: :#{name}, type: :#{field_type}#{', is_nullable: true' if nullable} }"
end