Class: Shoes::Link

Inherits:
Text show all
Defined in:
lib/shoes/text.rb

Instance Attribute Summary collapse

Attributes inherited from Text

#to_s

Instance Method Summary collapse

Constructor Details

#initialize(str, arg, &blk) ⇒ Link

Returns a new instance of Link.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/shoes/text.rb', line 50

def initialize str, arg, &blk
  @link_proc = if blk
    blk
  elsif arg[:click].is_a? String
    proc{Shoes.APPS.first.app.visit arg[:click]}
  elsif arg[:click].nil?
    proc{}
  else
    arg[:click]
  end

  @pos, @index, @link_hover = nil, nil, false
  super str
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



65
66
67
# File 'lib/shoes/text.rb', line 65

def index
  @index
end

Returns the value of attribute link_hover.



65
66
67
# File 'lib/shoes/text.rb', line 65

def link_hover
  @link_hover
end

Returns the value of attribute link_proc.



64
65
66
# File 'lib/shoes/text.rb', line 64

def link_proc
  @link_proc
end

#posObject

Returns the value of attribute pos.



65
66
67
# File 'lib/shoes/text.rb', line 65

def pos
  @pos
end