Class: W3cApi::Commands::Specification
- Inherits:
-
Thor
- Object
- Thor
- W3cApi::Commands::Specification
- Includes:
- OutputFormatter
- Defined in:
- lib/w3c_api/commands/specification.rb
Overview
Thor CLI command for specification operations
Instance Method Summary collapse
- #deliverers ⇒ Object
- #editors ⇒ Object
- #fetch ⇒ Object
- #superseded_by ⇒ Object
- #supersedes ⇒ Object
- #versions ⇒ Object
Methods included from OutputFormatter
Instance Method Details
#deliverers ⇒ Object
86 87 88 89 90 |
# File 'lib/w3c_api/commands/specification.rb', line 86 def deliverers client = W3cApi::Client.new deliverers = client.specification_deliverers([:shortname]) output_results(deliverers, [:format]) end |
#editors ⇒ Object
77 78 79 80 81 |
# File 'lib/w3c_api/commands/specification.rb', line 77 def editors client = W3cApi::Client.new editors = client.specification_editors([:shortname]) output_results(editors, [:format]) end |
#fetch ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/w3c_api/commands/specification.rb', line 19 def fetch client = W3cApi::Client.new specifications = if [:shortname] && [:version] # Single specification version client.specification_version([:shortname], [:version]) elsif [:shortname] # Single specification client.specification([:shortname]) elsif [:status] # Specifications by status client.specifications_by_status([:status]) else # All specifications client.specifications end # # Resolve links if specified # if options[:resolve] && specifications.respond_to?(:realize_links) # specifications.realize_links(options[:resolve], client) # end output_results(specifications, [:format]) end |
#superseded_by ⇒ Object
67 68 69 70 71 72 |
# File 'lib/w3c_api/commands/specification.rb', line 67 def superseded_by # We need to add client.specification_superseded_by method in the client client = W3cApi::Client.new specifications = client.specification_superseded_by([:shortname]) output_results(specifications, [:format]) end |
#supersedes ⇒ Object
57 58 59 60 61 62 |
# File 'lib/w3c_api/commands/specification.rb', line 57 def supersedes # We need to add client.specification_supersedes method in the client client = W3cApi::Client.new specifications = client.specification_supersedes([:shortname]) output_results(specifications, [:format]) end |