Class: DataDisplay::Actions::Display
- Inherits:
-
Object
- Object
- DataDisplay::Actions::Display
- Includes:
- ActionView::Helpers::NumberHelper, ActionView::Helpers::TextHelper, ActiveSupport::Inflector
- Defined in:
- lib/data_display/actions.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#raw_value ⇒ Object
readonly
Returns the value of attribute raw_value.
Instance Method Summary collapse
-
#initialize(raw_value, format) ⇒ Display
constructor
A new instance of Display.
- #value ⇒ Object
Constructor Details
#initialize(raw_value, format) ⇒ Display
Returns a new instance of Display.
10 11 12 13 |
# File 'lib/data_display/actions.rb', line 10 def initialize(raw_value, format) @raw_value = raw_value @format = format && format.to_sym end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
8 9 10 |
# File 'lib/data_display/actions.rb', line 8 def format @format end |
#raw_value ⇒ Object (readonly)
Returns the value of attribute raw_value.
8 9 10 |
# File 'lib/data_display/actions.rb', line 8 def raw_value @raw_value end |
Instance Method Details
#value ⇒ Object
15 16 17 |
# File 'lib/data_display/actions.rb', line 15 def value respond_to?(method_name, true) ? send(method_name) : raw_value end |