Class: Spinebox::Generator::Model
- Inherits:
-
Object
- Object
- Spinebox::Generator::Model
- Defined in:
- lib/spinebox/generator.rb
Overview
Generates a model
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#source_name ⇒ Object
readonly
Returns the value of attribute source_name.
Instance Method Summary collapse
-
#initialize(name, attributes = []) ⇒ Model
constructor
A new instance of Model.
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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
31 32 33 |
# File 'lib/spinebox/generator.rb', line 31 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
30 31 32 |
# File 'lib/spinebox/generator.rb', line 30 def name @name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
32 33 34 |
# File 'lib/spinebox/generator.rb', line 32 def source @source end |
#source_name ⇒ Object (readonly)
Returns the value of attribute source_name.
33 34 35 |
# File 'lib/spinebox/generator.rb', line 33 def source_name @source_name end |