Class: Wordsmith::Project
- Inherits:
-
Object
- Object
- Wordsmith::Project
- Defined in:
- lib/wordsmith/project.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
Class Method Summary collapse
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/wordsmith/project.rb', line 2 def name @name end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
2 3 4 |
# File 'lib/wordsmith/project.rb', line 2 def schema @schema end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
2 3 4 |
# File 'lib/wordsmith/project.rb', line 2 def slug @slug end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
2 3 4 |
# File 'lib/wordsmith/project.rb', line 2 def templates @templates end |
Class Method Details
.all ⇒ Object
4 5 6 7 |
# File 'lib/wordsmith/project.rb', line 4 def self.all projects_attributes = Wordsmith.client.get 'projects' projects_attributes.map {|p| new(**p)} end |
.find(slug) ⇒ Object
9 10 11 12 |
# File 'lib/wordsmith/project.rb', line 9 def self.find(slug) project = all.find { |p| p.slug == slug } project or fail %Q(Project not found with slug: "#{slug}") end |