Class: RubyMotionQuery::ViewData
- Inherits:
-
Object
- Object
- RubyMotionQuery::ViewData
- Defined in:
- motion/ruby_motion_query/data.rb
Instance Attribute Summary (collapse)
-
- (Object) events
Returns the value of attribute events.
-
- (Object) style_name
Returns the value of attribute style_name.
Instance Method Summary (collapse)
-
- (Boolean) has_tag?(tag_name = nil)
Check if this view contains a specific tag.
-
- (Object) tag(*tag_or_tags)
*Do not* use this, use RMQ#tag instead:.
-
- (Array) tag_names
Array of tag names assigned to to this view.
-
- (Hash) tags
Array of tag names assigned to to this view.
- - (Object) view_controller
- - (Object) view_controller=(value)
Instance Attribute Details
- (Object) events
Returns the value of attribute events
3 4 5 |
# File 'motion/ruby_motion_query/data.rb', line 3 def events @events end |
- (Object) style_name
Returns the value of attribute style_name
3 4 5 |
# File 'motion/ruby_motion_query/data.rb', line 3 def style_name @style_name end |
Instance Method Details
- (Boolean) has_tag?(tag_name = nil)
Check if this view contains a specific tag
39 40 41 42 43 44 45 |
# File 'motion/ruby_motion_query/data.rb', line 39 def has_tag?(tag_name = nil) if tag_name .include?(tag_name) else RMQ.is_blank?(@_tags) end end |
- (Object) tag(*tag_or_tags)
*Do not* use this, use RMQ#tag instead:
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'motion/ruby_motion_query/data.rb', line 18 def tag(*) .flatten! = .first if .length == 1 if .is_a?(Array) .each do |tag_name| [tag_name] = 1 end elsif .is_a?(Hash) .each do |tag_name, tag_value| [tag_name] = tag_value end elsif .is_a?(Symbol) [] = 1 end end |
- (Array) tag_names
Returns Array of tag names assigned to to this view
11 12 13 |
# File 'motion/ruby_motion_query/data.rb', line 11 def tag_names .keys end |
- (Hash) tags
Returns Array of tag names assigned to to this view
6 7 8 |
# File 'motion/ruby_motion_query/data.rb', line 6 def @_tags ||= {} end |
- (Object) view_controller
51 52 53 |
# File 'motion/ruby_motion_query/data.rb', line 51 def view_controller @view_controller end |
- (Object) view_controller=(value)
47 48 49 |
# File 'motion/ruby_motion_query/data.rb', line 47 def view_controller=(value) @view_controller = RubyMotionQuery::RMQ.weak_ref(value) end |