Class: HelloText

Inherits:
Object
  • Object
show all
Includes:
Glimmer::UI::CustomShell
Defined in:
lib/glimmer-dsl-opal/samples/hello/hello_text.rb

Overview

Copyright © 2020-2022 Andy Maleh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Instance Attribute Summary collapse

Attributes included from Glimmer::UI::CustomWidget

#body_root, #options, #parent, #swt_style

Instance Method Summary collapse

Methods included from Glimmer::UI::CustomShell

#close, encoded_request_parameter_string, #hide, included, #initialize, #open, request_parameter_string, requested?, requested_and_not_handled?, #show, #start_event_loop, #visible?

Methods included from Glimmer::UI::CustomWidget

add_custom_widget_namespaces_for, #add_observer, #async_exec, #attribute_setter, #can_add_observer?, #can_handle_observation_request?, #content, custom_widget_namespaces, for, #get_attribute, #handle_observation_request, #has_attribute?, #has_instance_method?, #has_style?, included, #initialize, #local_respond_to?, #method_missing, namespaces_for_class, #post_initialize_child, reset_custom_widget_namespaces, #respond_to?, #set_attribute, #sync_exec

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer::UI::CustomWidget

Instance Attribute Details

#centerObject

Returns the value of attribute center.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def center
  @center
end

#defaultObject

Returns the value of attribute default.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def default
  @default
end

#leftObject

Returns the value of attribute left.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def left
  @left
end

#multiObject

Returns the value of attribute multi.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def multi
  @multi
end

#no_borderObject

Returns the value of attribute no_border.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def no_border
  @no_border
end

#passwordObject

Returns the value of attribute password.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def password
  @password
end

#read_onlyObject

Returns the value of attribute read_only.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def read_only
  @read_only
end

#rightObject

Returns the value of attribute right.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def right
  @right
end

#telephoneObject

Returns the value of attribute telephone.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def telephone
  @telephone
end

#wrapObject

Returns the value of attribute wrap.



25
26
27
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 25

def wrap
  @wrap
end

Instance Method Details

#telephone?(text) ⇒ Boolean

Returns:

  • (Boolean)


144
145
146
# File 'lib/glimmer-dsl-opal/samples/hello/hello_text.rb', line 144

def telephone?(text)
  !!text.match(/^\d{0,3}[-.\/]?\d{0,3}[-.\/]?\d{0,4}$/)
end