Class: ListProjects
- Inherits:
-
Struct
- Object
- Struct
- ListProjects
- Defined in:
- lib/commands/list_projects.rb
Instance Attribute Summary collapse
-
#criteria ⇒ Object
Returns the value of attribute criteria.
-
#format ⇒ Object
Returns the value of attribute format.
Instance Method Summary collapse
- #call(formatter_class = formatter_class, projects = projects) ⇒ Object
- #default_format(projects = projects) ⇒ Object
- #formatter(formatter_class, format = format.present? ? eval(format) : default_format) ⇒ Object
- #projects(catalog = ProjectCatalog.load, criteria = criteria) ⇒ Object
Instance Attribute Details
#criteria ⇒ Object
Returns the value of attribute criteria
1 2 3 |
# File 'lib/commands/list_projects.rb', line 1 def criteria @criteria end |
#format ⇒ Object
Returns the value of attribute format
1 2 3 |
# File 'lib/commands/list_projects.rb', line 1 def format @format end |
Instance Method Details
#call(formatter_class = formatter_class, projects = projects) ⇒ Object
2 3 4 |
# File 'lib/commands/list_projects.rb', line 2 def call formatter_class = formatter_class, projects = projects formatter(formatter_class).present projects end |
#default_format(projects = projects) ⇒ Object
14 15 16 |
# File 'lib/commands/list_projects.rb', line 14 def default_format projects = projects {'Name' => 'name'}.merge list_properties_format properties end |
#formatter(formatter_class, format = format.present? ? eval(format) : default_format) ⇒ Object
10 11 12 |
# File 'lib/commands/list_projects.rb', line 10 def formatter(formatter_class, format = format.present? ? eval(format) : default_format) formatter_class.new format end |
#projects(catalog = ProjectCatalog.load, criteria = criteria) ⇒ Object
6 7 8 |
# File 'lib/commands/list_projects.rb', line 6 def projects catalog = ProjectCatalog.load, criteria = criteria catalog.projects criteria end |