Class: Tembin::Element::Base
- Inherits:
-
Object
- Object
- Tembin::Element::Base
- Extended by:
- FieldDefinationMacros
- Defined in:
- lib/tembin/element/base.rb
Direct Known Subclasses
Alert, Dashboard, Query, Visualizations, Visualizations::Chart, Visualizations::Chart::XAxis, Visualizations::Chart::YAxis, Visualizations::Chart::YAxis::Value
Constant Summary
Constants included from FieldDefinationMacros
FieldDefinationMacros::AVAILABLE_TYPES
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(*args, &block) ⇒ Base
constructor
A new instance of Base.
- #to_params ⇒ Object
Methods included from FieldDefinationMacros
Constructor Details
#initialize(*args, &block) ⇒ Base
Returns a new instance of Base.
29 30 31 32 33 |
# File 'lib/tembin/element/base.rb', line 29 def initialize(*args, &block) @name = args[0] @block = block @attributes = {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
27 28 29 |
# File 'lib/tembin/element/base.rb', line 27 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/tembin/element/base.rb', line 27 def name @name end |
Class Method Details
.build(*args, &block) ⇒ Object
23 24 25 |
# File 'lib/tembin/element/base.rb', line 23 def self.build(*args, &block) new(*args, &block).build end |
Instance Method Details
#build ⇒ Object
35 36 37 38 |
# File 'lib/tembin/element/base.rb', line 35 def build instance_exec(&@block) self end |
#to_params ⇒ Object
40 41 42 |
# File 'lib/tembin/element/base.rb', line 40 def to_params raise NotImplementedError end |