Class: Taksi::Values::Dynamic
- Inherits:
-
Object
- Object
- Taksi::Values::Dynamic
- Defined in:
- lib/taksi/values/dynamic.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #as_json ⇒ Object
- #dynamic? ⇒ Boolean
-
#initialize(component, name, field = nil) ⇒ Dynamic
constructor
A new instance of Dynamic.
- #path ⇒ Object
- #static? ⇒ Boolean
Constructor Details
#initialize(component, name, field = nil) ⇒ Dynamic
Returns a new instance of Dynamic.
8 9 10 11 12 |
# File 'lib/taksi/values/dynamic.rb', line 8 def initialize(component, name, field = nil) @component = component @name = name @field = field end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
6 7 8 |
# File 'lib/taksi/values/dynamic.rb', line 6 def component @component end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
6 7 8 |
# File 'lib/taksi/values/dynamic.rb', line 6 def field @field end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/taksi/values/dynamic.rb', line 6 def name @name end |
Instance Method Details
#as_json ⇒ Object
20 21 22 |
# File 'lib/taksi/values/dynamic.rb', line 20 def as_json nil end |
#dynamic? ⇒ Boolean
24 25 26 |
# File 'lib/taksi/values/dynamic.rb', line 24 def dynamic? true end |
#path ⇒ Object
14 15 16 17 18 |
# File 'lib/taksi/values/dynamic.rb', line 14 def path return field if field "#{component.id}.#{name}" end |
#static? ⇒ Boolean
28 29 30 |
# File 'lib/taksi/values/dynamic.rb', line 28 def static? false end |