Class: AzaharaSchema::Output
- Inherits:
-
Object
- Object
- AzaharaSchema::Output
- Defined in:
- lib/azahara_schema/output.rb
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Class Method Summary collapse
Instance Method Summary collapse
- #formatter(template) ⇒ Object
-
#initialize(schema) ⇒ Output
constructor
A new instance of Output.
- #key ⇒ Object
- #model ⇒ Object
- #model_i18n_key ⇒ Object
- #model_name ⇒ Object
-
#to_partial_path ⇒ Object
rendering.
Constructor Details
#initialize(schema) ⇒ Output
Returns a new instance of Output.
14 15 16 |
# File 'lib/azahara_schema/output.rb', line 14 def initialize(schema) @schema = schema end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
4 5 6 |
# File 'lib/azahara_schema/output.rb', line 4 def schema @schema end |
Class Method Details
.key ⇒ Object
6 7 8 |
# File 'lib/azahara_schema/output.rb', line 6 def self.key self.name.split('::').last.sub(/Output$/, '').underscore end |
Instance Method Details
#formatter(template) ⇒ Object
35 36 37 |
# File 'lib/azahara_schema/output.rb', line 35 def formatter(template) template.attribute_formatter_for(schema) end |
#key ⇒ Object
10 11 12 |
# File 'lib/azahara_schema/output.rb', line 10 def key self.class.key end |
#model ⇒ Object
18 19 20 |
# File 'lib/azahara_schema/output.rb', line 18 def model @schema.model end |
#model_i18n_key ⇒ Object
26 27 28 |
# File 'lib/azahara_schema/output.rb', line 26 def model_i18n_key model_name.i18n_key end |
#model_name ⇒ Object
22 23 24 |
# File 'lib/azahara_schema/output.rb', line 22 def model_name model.model_name end |
#to_partial_path ⇒ Object
rendering
31 32 33 |
# File 'lib/azahara_schema/output.rb', line 31 def to_partial_path 'azahara_schema/outputs/'+key end |