Class: Spinebox::Generator::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/spinebox/generator.rb

Overview

Generates a model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attributes = []) ⇒ Model

Returns a new instance of Model.



35
36
37
38
39
# File 'lib/spinebox/generator.rb', line 35

def initialize name, attributes = []
  @name, @source_name, @attributes = name.camelize, name, attributes
  compile_template
  write_source
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



31
32
33
# File 'lib/spinebox/generator.rb', line 31

def attributes
  @attributes
end

#nameObject (readonly)

Returns the value of attribute name.



30
31
32
# File 'lib/spinebox/generator.rb', line 30

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source.



32
33
34
# File 'lib/spinebox/generator.rb', line 32

def source
  @source
end

#source_nameObject (readonly)

Returns the value of attribute source_name.



33
34
35
# File 'lib/spinebox/generator.rb', line 33

def source_name
  @source_name
end