Class: Google::Visualization::DataColumn
- Inherits:
-
DataElement
- Object
- DataElement
- Google::Visualization::DataColumn
- Defined in:
- lib/google_visualization/data_column.rb
Overview
DataColumn
Description
Represents the schema of a column in a DataTable.
Instance Method Summary collapse
-
#close ⇒ Object
Prevents the type from being altered.
-
#closed? ⇒ Boolean
Returns true if closed.
-
#id ⇒ Object
Returns the id.
-
#id=(obj) ⇒ Object
Sets a id.
-
#initialize(type = nil, label = nil, id = nil) ⇒ DataColumn
constructor
Creates a new column.
-
#label ⇒ Object
Returns the label.
-
#label=(obj) ⇒ Object
Sets a type.
-
#pattern ⇒ Object
Returns the pattern.
-
#pattern=(obj) ⇒ Object
Sets a pattern.
-
#type ⇒ Object
Returns the type.
-
#type=(obj) ⇒ Object
Sets a type.
Methods inherited from DataElement
#custom_properties, #custom_properties_count, #custom_property, #store_custom_properties, #store_custom_property
Constructor Details
#initialize(type = nil, label = nil, id = nil) ⇒ DataColumn
Creates a new column.
16 17 18 19 20 21 22 23 |
# File 'lib/google_visualization/data_column.rb', line 16 def initialize(type=nil, label=nil, id=nil) super() @closed = false self.id = id self.type = type || DataType::STRING self.label = label self.pattern = "" end |
Instance Method Details
#close ⇒ Object
Prevents the type from being altered.
86 87 88 |
# File 'lib/google_visualization/data_column.rb', line 86 def close @closed = true end |
#closed? ⇒ Boolean
Returns true if closed.
93 94 95 |
# File 'lib/google_visualization/data_column.rb', line 93 def closed? @closed end |
#id ⇒ Object
Returns the id.
28 29 30 |
# File 'lib/google_visualization/data_column.rb', line 28 def id @id end |
#id=(obj) ⇒ Object
Sets a id.
35 36 37 |
# File 'lib/google_visualization/data_column.rb', line 35 def id=(obj) @id = obj end |
#label ⇒ Object
Returns the label.
58 59 60 |
# File 'lib/google_visualization/data_column.rb', line 58 def label @label end |
#label=(obj) ⇒ Object
Sets a type.
65 66 67 |
# File 'lib/google_visualization/data_column.rb', line 65 def label=(obj) @label = obj end |
#pattern ⇒ Object
Returns the pattern.
72 73 74 |
# File 'lib/google_visualization/data_column.rb', line 72 def pattern @pattern end |
#pattern=(obj) ⇒ Object
Sets a pattern.
79 80 81 |
# File 'lib/google_visualization/data_column.rb', line 79 def pattern=(obj) @pattern = obj end |
#type ⇒ Object
Returns the type.
42 43 44 |
# File 'lib/google_visualization/data_column.rb', line 42 def type @type end |
#type=(obj) ⇒ Object
Sets a type.
49 50 51 52 53 |
# File 'lib/google_visualization/data_column.rb', line 49 def type=(obj) raise(StandardError, "can't modify closed column") if @closed raise(TypeError, "wrong argument type #{obj.class}, should be DataType") unless obj.is_a?(DataType) @type = obj end |