Class: Ariadne::Forms::Dsl::Status
- Inherits:
-
Object
- Object
- Ariadne::Forms::Dsl::Status
- Includes:
- InputMethods
- Defined in:
- lib/ariadne/forms/dsl/status.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#form ⇒ Object
readonly
Returns the value of attribute form.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(builder:, form:, text:, **options) {|_self| ... } ⇒ Status
constructor
A new instance of Status.
- #input? ⇒ Boolean
- #to_component ⇒ Object
- #type ⇒ Object
Methods included from InputMethods
#action_menu, #auto_complete, #button, #check_box, #check_box_group, #clipboard_copy_button, #fields_for, #hidden, #inputs, #multi, #radio_button_group, #select_list, #separator, #status, #submit, #text_area, #text_field
Constructor Details
#initialize(builder:, form:, text:, **options) {|_self| ... } ⇒ Status
Returns a new instance of Status.
12 13 14 15 16 17 18 19 |
# File 'lib/ariadne/forms/dsl/status.rb', line 12 def initialize(builder:, form:, text:, **) @builder = builder @form = form @text = text @options = yield(self) if block_given? end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
10 11 12 |
# File 'lib/ariadne/forms/dsl/status.rb', line 10 def builder @builder end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
10 11 12 |
# File 'lib/ariadne/forms/dsl/status.rb', line 10 def form @form end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/ariadne/forms/dsl/status.rb', line 10 def @options end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
10 11 12 |
# File 'lib/ariadne/forms/dsl/status.rb', line 10 def text @text end |
Instance Method Details
#input? ⇒ Boolean
32 33 34 |
# File 'lib/ariadne/forms/dsl/status.rb', line 32 def input? false end |
#to_component ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ariadne/forms/dsl/status.rb', line 21 def to_component leading_visual_heroicon = @options.delete(:leading_visual_heroicon) badge = Ariadne::UI::Badge::Component.new(text: @text, **@options) badge.with_leading_visual_heroicon(**leading_visual_heroicon) badge end |
#type ⇒ Object
28 29 30 |
# File 'lib/ariadne/forms/dsl/status.rb', line 28 def type :status end |