Skip to content

Instantly share code, notes, and snippets.

View AndyObtiva's full-sized avatar

Andy Maleh AndyObtiva

View GitHub Profile
class AddressTypeSelect
include Glimmer::Web::Component
attribute :address_types, default: []
attribute :selected_address_type
markup {
select { |select_element|
address_types.each do |address_type|
option(value: address_type) { address_type }
...
markup {
div {
...
multi_checkbox_dropdown(values: SomePresenter::STATUS_FILTER_TYPES)
...
}
}
...
option :values, default: []
option :display_values
option :selected_values, default: []
option :locale, default: :en
option :translations, default: {}
option :selected_values_formatter, default: SELECTED_VALUES_FORMATTER_DEFAULT
option :width, default: 175
option :height, default: 40
option :margin, default: '0 15px 0 0'
option :text_align, default: :center
...
markup {
div {
...
multi_checkbox_dropdown(
values: SomePresenter::STATUS_FILTER_TYPES,
display_values: SomePresenter::STATUS_FILTER_TYPES.map(&:capitalize),
locale: I18n.locale,
width: 190,
translations: {
...
markup {
div {
...
multi_checkbox_dropdown(values: SomePresenter::STATUS_FILTER_TYPES) {
selected_values <=> [@some_presenter, :status_filters]
}
...
}
}
...
markup {
div {
...
multi_checkbox_dropdown(values: SomePresenter::STATUS_FILTER_TYPES) {
on_change do |selected_values|
# do something with selected_values
end
}
...

Glimmer Hangman Icon Glimmer Hangman 1.0.0

Gem Version

Hangman (word game) that runs on Mac, Windows, and Linux. Built with Ruby and Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library) using Application Scaffolding.

Implementation started at the RubyConf 2024 Hack Day Event for Glimmer DSL for LibUI, which was connected to the [RubyConf 2024 workshop "How To Build Basic Desktop Applicatio

# Source: https://github.com/AndyObtiva/glimmer_hangman/blob/master/app/glimmer_hangman/view/hangman_guessed_letters.rb
require 'glimmer_hangman/model/game'
class GlimmerHangman
module View
class HangmanGuessedLetters
include Glimmer::LibUI::CustomShape
option :game
option :size, default: 480
# Source: https://github.com/AndyObtiva/glimmer_hangman/blob/master/app/glimmer_hangman/view/hangman_guess.rb
require 'glimmer_hangman/model/game'
class GlimmerHangman
module View
class HangmanGuess
include Glimmer::LibUI::CustomShape
option :game
option :size, default: 480
# Source: https://github.com/AndyObtiva/glimmer_hangman/blob/master/app/glimmer_hangman/view/hangman.rb
require 'glimmer_hangman/model/game'
class GlimmerHangman
module View
class HangmanScene
include Glimmer::LibUI::CustomShape
option :game
option :size, default: 480