Class: Reflex::Selector

Inherits:
Object
  • Object
show all
Includes:
HasTags, Xot::Setter
Defined in:
lib/reflex/selector.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasTags

#clear_tags, #tag, #tag=, #tags, #untag

Constructor Details

#initialize(options = nil, &block) ⇒ Selector

Returns a new instance of Selector.



23
24
25
26
27
# File 'lib/reflex/selector.rb', line 23

def initialize (options = nil, &block)
  super()
  set options if options
  Xot::BlockUtil.instance_eval_or_block_call self, &block if block
end

Class Method Details

.selector(*args) ⇒ Object



18
19
20
21
# File 'lib/reflex/selector.rb', line 18

def self.selector (*args)
  arg0 = args.first
  arg0.kind_of?(Selector) ? arg0 : self.new(*args)
end

Instance Method Details

#inspectObject



33
34
35
# File 'lib/reflex/selector.rb', line 33

def inspect ()
  "#<#{self.class} #{to_s}>"
end

#to_sObject



29
30
31
# File 'lib/reflex/selector.rb', line 29

def to_s ()
  "{name:#{name}, tags:[#{tags.to_a.join ', '}]}"
end