Class: ThinReports::Core::Shape::Basic::Interface

Inherits:
ThinReports::Core::Shape::Base::Interface show all
Defined in:
lib/thinreports/core/shape/basic/interface.rb

Instance Attribute Summary

Attributes inherited from ThinReports::Core::Shape::Base::Interface

#internal

Instance Method Summary collapse

Methods inherited from ThinReports::Core::Shape::Base::Interface

#copy, #initialize

Constructor Details

This class inherits a constructor from ThinReports::Core::Shape::Base::Interface

Instance Method Details

#hideself

Returns:

  • (self)

See Also:



62
63
64
65
# File 'lib/thinreports/core/shape/basic/interface.rb', line 62

def hide
  visible(false)
  self
end

#idString

Returns:

  • (String)


10
11
12
# File 'lib/thinreports/core/shape/basic/interface.rb', line 10

def id
  internal.id.dup
end

#showself

Returns:

  • (self)

See Also:



69
70
71
72
# File 'lib/thinreports/core/shape/basic/interface.rb', line 69

def show
  visible(true)
  self
end

#style(style_name) ⇒ Object #style(style_name, value) ⇒ self #style(style_name, value1, value2) ⇒ self

Overloads:

  • #style(style_name) ⇒ Object

    Parameters:

    • style_name (Symbol)

    Returns:

  • #style(style_name, value) ⇒ self

    Parameters:

    • style_name (Symbol)
    • value (String, Symbol, Number, Array)

    Returns:

    • (self)
  • #style(style_name, value1, value2) ⇒ self

    Parameters:

    • style_name (Symbol)
    • value1 (String, Number)
    • value2 (String, Number)

    Returns:

    • (self)


38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/thinreports/core/shape/basic/interface.rb', line 38

def style(*args)
  case args.length
  when 1
    internal.style[args.first]
  when 2
    internal.style[args.first] = args.last
    self
  when 3
    internal.style[args.shift] = args
    self
  else
    raise ArgumentError, '#style requires 1 or 2, 3 arguments'
  end
end

#styles(settings) ⇒ self

Parameters:

  • settings (Hash)

    :style_name => value

Returns:

  • (self)


55
56
57
58
# File 'lib/thinreports/core/shape/basic/interface.rb', line 55

def styles(settings)
  settings.each{ |args| style(*args) }
  self
end

#visible(visibility) ⇒ self

Parameters:

  • visibility (Boolean)

Returns:

  • (self)


16
17
18
19
# File 'lib/thinreports/core/shape/basic/interface.rb', line 16

def visible(visibility)
  internal.style.visible = visibility
  self
end

#visible?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/thinreports/core/shape/basic/interface.rb', line 22

def visible?
  internal.style.visible
end