Class: Nexter::Model
- Inherits:
-
Object
- Object
- Nexter::Model
- Defined in:
- lib/nexter/model.rb,
lib/nexter/model/parse_order.rb
Defined Under Namespace
Classes: ParseOrder
Instance Attribute Summary collapse
-
#associations ⇒ Object
readonly
Returns the value of attribute associations.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#order_values ⇒ Object
readonly
Returns the value of attribute order_values.
Instance Method Summary collapse
-
#initialize(model, relation) ⇒ Model
constructor
A new instance of Model.
- #values ⇒ Object
Constructor Details
#initialize(model, relation) ⇒ Model
Returns a new instance of Model.
6 7 8 9 |
# File 'lib/nexter/model.rb', line 6 def initialize(model, relation) @model = model @order_values = ParseOrder.parse(relation.order_values) end |
Instance Attribute Details
#associations ⇒ Object (readonly)
Returns the value of attribute associations.
4 5 6 |
# File 'lib/nexter/model.rb', line 4 def associations @associations end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
3 4 5 |
# File 'lib/nexter/model.rb', line 3 def model @model end |
#order_values ⇒ Object (readonly)
Returns the value of attribute order_values.
4 5 6 |
# File 'lib/nexter/model.rb', line 4 def order_values @order_values end |
Instance Method Details
#values ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/nexter/model.rb', line 11 def values @values ||= @order_values.map do |column| next unless value = value_of(column[0]) { col: column[0], val: value, dir: column[1] } end.compact end |