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.



20
21
22
23
24
# File 'lib/reflex/selector.rb', line 20

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



15
16
17
18
# File 'lib/reflex/selector.rb', line 15

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

Instance Method Details

#inspectObject



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

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

#to_sObject



26
27
28
# File 'lib/reflex/selector.rb', line 26

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