Class: Wordsmith::Template
- Inherits:
-
Object
- Object
- Wordsmith::Template
- Defined in:
- lib/wordsmith/template.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Instance Method Summary collapse
- #generate(data) ⇒ Object
-
#initialize(name: nil, slug: nil, project: nil, **attributes) ⇒ Template
constructor
A new instance of Template.
Constructor Details
#initialize(name: nil, slug: nil, project: nil, **attributes) ⇒ Template
Returns a new instance of Template.
4 5 6 7 8 9 |
# File 'lib/wordsmith/template.rb', line 4 def initialize(name: nil, slug: nil, project: nil, **attributes) raise "Missing required keyword arguments" unless [name, slug, project].all? @name = name @slug = slug @project = project end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/wordsmith/template.rb', line 2 def name @name end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
2 3 4 |
# File 'lib/wordsmith/template.rb', line 2 def project @project end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
2 3 4 |
# File 'lib/wordsmith/template.rb', line 2 def slug @slug end |