class LibyuiClient::App

Public Class Methods

new(host:, port:) click to toggle source

Used to initialize main entry point of LibyuiClient and set host and port for the application under control. @param host [String] host address (e.g. 'localhost', '192.168.0.1') @param port [String] port opened for communication (e.g. '9999')

# File lib/libyui_client/app.rb, line 9
def initialize(host:, port:)
  @host = host
  @port = port
  @widget_controller = Http::WidgetController.new(host: host, port: port)
  @version_controller = Http::VersionController.new(host: host, port: port)
end

Public Instance Methods

bargraph(filter) click to toggle source

Initializes new instance of Bargraph with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Bargraph] new instance of Table @example

app.bargraph(id: 'id', label: 'label', class: 'YBarGraph')
# File lib/libyui_client/app.rb, line 22
def bargraph(filter)
  Widgets::Bargraph.new(@widget_controller, FilterExtractor.new(filter))
end
button(filter) click to toggle source

Initializes new instance of Button with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Button] new instance of Button @example

app.button(id: 'id', label: 'label', class: 'YPushButton')
# File lib/libyui_client/app.rb, line 32
def button(filter)
  Widgets::Button.new(@widget_controller, FilterExtractor.new(filter))
end
check_api_version() click to toggle source

Validates if server side REST API is compatible with client inside @return true if version is compatible, false if not or any error while

receiving version from the server
# File lib/libyui_client/app.rb, line 221
def check_api_version
  LibyuiClient.logger.info("Client API version: #{API_VERSION}")
  server_api_v = server_api_version
  raise Error::LibyuiClientError if server_api_v.nil?

  LibyuiClient.logger.info("Server API version: #{server_api_v}")
  server_api_v <= client_api_version
end
checkbox(filter) click to toggle source

Initializes new instance of Checkbox with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Checkbox] new instance of Checkbox @example

app.checkbox(id: 'id', label: 'label', class: 'YCheckBox')
# File lib/libyui_client/app.rb, line 42
def checkbox(filter)
  Widgets::Checkbox.new(@widget_controller, FilterExtractor.new(filter))
end
client_api_version() click to toggle source

Returns client side libyui REST API version @return libyui client REST API version

# File lib/libyui_client/app.rb, line 208
def client_api_version
  API_VERSION
end
combobox(filter) click to toggle source

Initializes new instance of Combobox with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Combobox] new instance of Combobox @example

app.combobox(id: 'id', label: 'label', class: 'YComboBox')
# File lib/libyui_client/app.rb, line 52
def combobox(filter)
  Widgets::Combobox.new(@widget_controller, FilterExtractor.new(filter))
end
datefield(filter) click to toggle source

Initializes new instance of Datefield with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Datefield] new instance of Datefield @example

app.datefield(id: 'id', label: 'label', class: 'YDateField')
# File lib/libyui_client/app.rb, line 62
def datefield(filter)
  Widgets::Datefield.new(@widget_controller, FilterExtractor.new(filter))
end
label(filter) click to toggle source

Initializes new instance of Label with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Label] new instance of Label @example

app.label(id: 'id', label: 'label', class: 'YLabel')
# File lib/libyui_client/app.rb, line 72
def label(filter)
  Widgets::Label.new(@widget_controller, FilterExtractor.new(filter))
end
menubutton(filter) click to toggle source

Initializes new instance of Menubutton with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Menubutton] new instance of Menubutton @example

app.menubutton(id: 'id', label: 'label', class: 'YMenuButton')
multilinebox(filter) click to toggle source

Initializes new instance of Multilinebox with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Multilinebox] new instance of Multilinebox @example

app.multilinebox(id: 'id', label: 'label', class: 'YMultiLineEdit')
# File lib/libyui_client/app.rb, line 92
def multilinebox(filter)
  Widgets::Multilinebox.new(@widget_controller, FilterExtractor.new(filter))
end
numberbox(filter) click to toggle source

Initializes new instance of Numberbox with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Numberbox] new instance of Numberbox @example

app.numberbox(id: 'id', label: 'label', class: 'YIntField')
# File lib/libyui_client/app.rb, line 102
def numberbox(filter)
  Widgets::Numberbox.new(@widget_controller, FilterExtractor.new(filter))
end
progressbar(filter) click to toggle source

Initializes new instance of Progressbar with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Progressbar] new instance of Progressbar @example

app.progressbar(id: 'id', label: 'label', class: 'YProgressBar')
# File lib/libyui_client/app.rb, line 112
def progressbar(filter)
  Widgets::Progressbar.new(@widget_controller, FilterExtractor.new(filter))
end
radiobutton(filter) click to toggle source

Initializes new instance of Radiobutton with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Radiobutton] new instance of Radiobutton @example

app.radiobutton(id: 'id', label: 'label', class: 'YRadioButton')
# File lib/libyui_client/app.rb, line 122
def radiobutton(filter)
  Widgets::Radiobutton.new(@widget_controller, FilterExtractor.new(filter))
end
richtext(filter) click to toggle source

Initializes new instance of Richtext with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Richtext] new instance of Richtext @example

app.richtext(id: 'id', label: 'label', class: 'YRichText')
# File lib/libyui_client/app.rb, line 132
def richtext(filter)
  Widgets::Richtext.new(@widget_controller, FilterExtractor.new(filter))
end
selectionbox(filter) click to toggle source

Initializes new instance of Selectionbox with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Selectionbox] new instance of Selectionbox @example

app.selectionbox(id: 'id', label: 'label', class: 'YSelectionBox')
# File lib/libyui_client/app.rb, line 142
def selectionbox(filter)
  Widgets::Selectionbox.new(@widget_controller, FilterExtractor.new(filter))
end
server_api_version() click to toggle source

Returns server side libyui REST API version @return libyui server REST API version

# File lib/libyui_client/app.rb, line 214
def server_api_version
  @version_controller.api_version
end
tab(filter) click to toggle source

Initializes new instance of Tab with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Tab] new instance of Tab @example

app.tab(id: 'id', label: 'label', class: 'YDumbTab')
# File lib/libyui_client/app.rb, line 152
def tab(filter)
  Widgets::Tab.new(@widget_controller, FilterExtractor.new(filter))
end
table(filter) click to toggle source

Initializes new instance of Table with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Table] new instance of Table @example

app.table(id: 'id', label: 'label', class: 'YTable')
# File lib/libyui_client/app.rb, line 162
def table(filter)
  Widgets::Table.new(@widget_controller, FilterExtractor.new(filter))
end
textbox(filter) click to toggle source

Initializes new instance of Textbox with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Textbox] new instance of Textbox @example

app.textbox(id: 'id', label: 'label', class: 'YInputField')
# File lib/libyui_client/app.rb, line 182
def textbox(filter)
  Widgets::Textbox.new(@widget_controller, FilterExtractor.new(filter))
end
timefield(filter) click to toggle source

Initializes new instance of time field with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Timefield] new instance of Table @example

app.timefield(id: 'id', label: 'label', class: 'YTimeField')
# File lib/libyui_client/app.rb, line 172
def timefield(filter)
  Widgets::Timefield.new(@widget_controller, FilterExtractor.new(filter))
end
tree(filter) click to toggle source

Initializes new instance of Tree with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Tree] new instance of Tree @example

app.tree(id: 'id', label: 'label', class: 'YTree')
# File lib/libyui_client/app.rb, line 192
def tree(filter)
  Widgets::Tree.new(@widget_controller, FilterExtractor.new(filter))
end
wizard(filter) click to toggle source

Initializes new instance of Wizard with the filter provided. Does not make request to libyui-rest-api. @param filter [Hash] filter to find a widget @return [Widgets::Wizard] new instance of Wizard @example

app.wizard(id: 'id', label: 'label', class: 'YWizard')
# File lib/libyui_client/app.rb, line 202
def wizard(filter)
  Widgets::Wizard.new(@widget_controller, FilterExtractor.new(filter))
end