Class: Nexmo::OAS::Renderer::Presenters::ResponseTab::Link
- Inherits:
-
Object
- Object
- Nexmo::OAS::Renderer::Presenters::ResponseTab::Link
- Defined in:
- lib/nexmo/oas/renderer/presenters/response_tab/link.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Instance Method Summary collapse
- #content ⇒ Object
- #css_classes ⇒ Object
- #data_tab_link ⇒ Object
-
#initialize(index:, schema:) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(index:, schema:) ⇒ Link
Returns a new instance of Link.
11 12 13 14 |
# File 'lib/nexmo/oas/renderer/presenters/response_tab/link.rb', line 11 def initialize(index:, schema:) @index = index @schema = schema end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
9 10 11 |
# File 'lib/nexmo/oas/renderer/presenters/response_tab/link.rb', line 9 def index @index end |
Instance Method Details
#content ⇒ Object
28 29 30 |
# File 'lib/nexmo/oas/renderer/presenters/response_tab/link.rb', line 28 def content @schema['description'] || "Response #{@index + 1}" end |
#css_classes ⇒ Object
16 17 18 19 20 |
# File 'lib/nexmo/oas/renderer/presenters/response_tab/link.rb', line 16 def css_classes classes = ['tab-sync Vlt-tabs__link'] classes << 'Vlt-tabs__link_active' if @index.zero? classes.join(' ') end |
#data_tab_link ⇒ Object
22 23 24 25 26 |
# File 'lib/nexmo/oas/renderer/presenters/response_tab/link.rb', line 22 def data_tab_link return nil unless @schema['x-tab-id'] @schema['x-tab-id'] end |