Class: GoodData::TextItem
- Inherits:
-
DashboardItem
- Object
- Rest::Object
- Rest::Resource
- DashboardItem
- GoodData::TextItem
- Defined in:
- lib/gooddata/models/metadata/dashboard/text_item.rb
Constant Summary collapse
- EMPTY_OBJECT =
{ 'textItem' => { 'positionX' => 0, 'sizeY' => 200, 'sizeX' => 300, 'positionY' => 0 } }
- ASSIGNABLE_MEMBERS =
DashboardItem::ASSIGNABLE_MEMBERS + [ :text, :text_size ]
Instance Attribute Summary
Attributes inherited from DashboardItem
Attributes inherited from Rest::Object
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tab, json) ⇒ TextItem
constructor
A new instance of TextItem.
- #text ⇒ Object
- #text=(new_text) ⇒ Object
- #text_size ⇒ Object
- #text_size=(new_text_size) ⇒ Object
Methods inherited from DashboardItem
#filters, #filters=, #position_x, #position_x=, #position_y, #position_y=, #size_x, #size_x=, #size_y, #size_y=
Methods included from Mixin::ObjId
Methods inherited from Rest::Object
client, default_client, #saved?
Methods included from Mixin::DataPropertyReader
Methods included from Mixin::DataPropertyWriter
Methods included from Mixin::MetaPropertyReader
Methods included from Mixin::MetaPropertyWriter
Methods included from Mixin::MetaGetter
Methods included from Mixin::DataGetter
Methods included from Mixin::RootKeyGetter
Methods included from Mixin::ContentGetter
Constructor Details
permalink #initialize(tab, json) ⇒ TextItem
Returns a new instance of TextItem.
35 36 37 |
# File 'lib/gooddata/models/metadata/dashboard/text_item.rb', line 35 def initialize(tab, json) super end |
Class Method Details
permalink .create(tab, item) ⇒ Object
[View source]
26 27 28 29 30 31 32 |
# File 'lib/gooddata/models/metadata/dashboard/text_item.rb', line 26 def create(tab, item) res = GoodData::TextItem.new(tab, GoodData::Helpers.deep_dup(GoodData::Helpers.stringify_keys(EMPTY_OBJECT))) item.each do |k, v| res.send("#{k}=", v) if ASSIGNABLE_MEMBERS.include? k end res end |
Instance Method Details
permalink #text ⇒ Object
[View source]
39 40 41 |
# File 'lib/gooddata/models/metadata/dashboard/text_item.rb', line 39 def text data['text'] end |
permalink #text=(new_text) ⇒ Object
[View source]
43 44 45 |
# File 'lib/gooddata/models/metadata/dashboard/text_item.rb', line 43 def text=(new_text) data['text'] = new_text end |
permalink #text_size ⇒ Object
[View source]
47 48 49 |
# File 'lib/gooddata/models/metadata/dashboard/text_item.rb', line 47 def text_size data['textSize'] end |
permalink #text_size=(new_text_size) ⇒ Object
[View source]
51 52 53 |
# File 'lib/gooddata/models/metadata/dashboard/text_item.rb', line 51 def text_size=(new_text_size) data['textSize'] = new_text_size end |