Module: Thinreports::BasicReport::Core::Shape::Manager::Target
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Utils
#blank_value?, #call_block_in, #deep_copy, included
Instance Attribute Details
#manager ⇒ Object
Returns the value of attribute manager.
11
12
13
|
# File 'lib/thinreports/basic_report/core/shape/manager/target.rb', line 11
def manager
@manager
end
|
Instance Method Details
48
49
50
|
# File 'lib/thinreports/basic_report/core/shape/manager/target.rb', line 48
def [](id)
item(id)
end
|
#[]=(id, value) ⇒ Object
60
61
62
|
# File 'lib/thinreports/basic_report/core/shape/manager/target.rb', line 60
def []=(id, value)
item(id).value = value
end
|
#item_exists?(id) ⇒ Boolean
Also known as:
exists?
74
75
76
|
# File 'lib/thinreports/basic_report/core/shape/manager/target.rb', line 74
def item_exists?(id)
!manager.find_format(id).nil?
end
|
#list(id = nil, &block) ⇒ Object
87
88
89
90
91
92
93
94
|
# File 'lib/thinreports/basic_report/core/shape/manager/target.rb', line 87
def list(id = nil, &block)
shape = find_item(id ||= :default, only: Core::Shape::List::TYPE_NAME)
raise Thinreports::BasicReport::Errors::UnknownItemId.new(id, 'List') unless shape
manager.lists[id.to_sym] ||= shape
call_block_in(shape, &block)
end
|
#values(item_values) ⇒ Object
68
69
70
|
# File 'lib/thinreports/basic_report/core/shape/manager/target.rb', line 68
def values(item_values)
item_values.each { |id, val| item(id).value(val) }
end
|