Class: Mixin::Generators::Structure

Inherits:
Object
  • Object
show all
Defined in:
lib/fox/interface/thor/mixin/generators/structure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, structure_name, params) ⇒ Structure

Returns a new instance of Structure.

Parameters:

  • type (Symbol)

    Type of Structure (class, enum)

  • structure_name (String)

    Name for structure

  • params (Hash)

    Fields for user defined structure



27
28
29
30
31
32
33
34
35
# File 'lib/fox/interface/thor/mixin/generators/structure.rb', line 27

def initialize type, structure_name, params
  @type = type
  if @type == :class 
    raise RuntimeException.new("Params for #{structure_name} empty") if params.size == 0
    @structure_name, @params = structure_name, params
  else 
    @structure_name = structure_name
  end
end

Instance Attribute Details

#- params [Hash] with types and names of params arguments=(value) ⇒ Object (writeonly)



19
# File 'lib/fox/interface/thor/mixin/generators/structure.rb', line 19

attr_accessor :structure_name, :params, :type

#- structure type=(value) ⇒ Object (writeonly)



19
# File 'lib/fox/interface/thor/mixin/generators/structure.rb', line 19

attr_accessor :structure_name, :params, :type

#- structure_name [Symbol] from generated ruby code=(value) ⇒ Object (writeonly)



19
# File 'lib/fox/interface/thor/mixin/generators/structure.rb', line 19

attr_accessor :structure_name, :params, :type

#paramsObject

Returns the value of attribute params.



19
20
21
# File 'lib/fox/interface/thor/mixin/generators/structure.rb', line 19

def params
  @params
end

#structure_nameObject

Returns the value of attribute structure_name.



19
20
21
# File 'lib/fox/interface/thor/mixin/generators/structure.rb', line 19

def structure_name
  @structure_name
end

#typeObject

Returns the value of attribute type.



19
20
21
# File 'lib/fox/interface/thor/mixin/generators/structure.rb', line 19

def type
  @type
end