Module: UnderOs::UI::Commons
- Included in:
- View
- Defined in:
- lib/under_os/ui/utils/commons.rb
Instance Method Summary collapse
- #data(key = nil) ⇒ Object
- #data=(hash) ⇒ Object
- #hidden ⇒ Object (also: #hidden?)
- #hide ⇒ Object
- #id ⇒ Object
- #id=(id) ⇒ Object
- #page ⇒ Object
- #show ⇒ Object
- #tagName ⇒ Object
- #toggle ⇒ Object
- #visible ⇒ Object (also: #visible?)
Instance Method Details
#data(key = nil) ⇒ Object
28 29 30 |
# File 'lib/under_os/ui/utils/commons.rb', line 28 def data(key=nil) key && @_data ? @_data[key.to_sym] : @_data end |
#data=(hash) ⇒ Object
32 33 34 |
# File 'lib/under_os/ui/utils/commons.rb', line 32 def data=(hash) @_data = hash end |
#hidden ⇒ Object Also known as:
60 61 62 |
# File 'lib/under_os/ui/utils/commons.rb', line 60 def hidden @_.isHidden end |
#hide ⇒ Object
48 49 50 |
# File 'lib/under_os/ui/utils/commons.rb', line 48 def hide style.display = :none end |
#id ⇒ Object
2 3 4 |
# File 'lib/under_os/ui/utils/commons.rb', line 2 def id @_id end |
#id=(id) ⇒ Object
6 7 8 |
# File 'lib/under_os/ui/utils/commons.rb', line 6 def id=(id) @_id = id end |
#page ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/under_os/ui/utils/commons.rb', line 36 def page resp = @_ while resp = resp.nextResponder if resp.is_a?(UIViewController) return resp.wrapper end end nil end |
#show ⇒ Object
52 53 54 |
# File 'lib/under_os/ui/utils/commons.rb', line 52 def show style.display = :block end |
#tagName ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/under_os/ui/utils/commons.rb', line 10 def tagName @_tag_name ||= begin wraps = UnderOs::UI::Wrap::WRAPS_TAGS_MAP klass = self.class; tag = 'VIEW' while klass if wrap = wraps.detect{|t,k| k == klass} tag = wrap[0].upcase break else klass = klass.superclass end end tag end end |
#toggle ⇒ Object
56 57 58 |
# File 'lib/under_os/ui/utils/commons.rb', line 56 def toggle hidden ? show : hide end |
#visible ⇒ Object Also known as: visible?
64 65 66 |
# File 'lib/under_os/ui/utils/commons.rb', line 64 def visible !hidden end |