Class: ExtractVariableStub
- Inherits:
-
Object
- Object
- ExtractVariableStub
- Defined in:
- app/models/extract_variable_stub.rb
Overview
For area-level extracts, we include geog_level and geog_instance fields, but these aren’t part of the request structure, which means that they need to be provided to the syntax generation system directly. This stub class provides a way to do that. data_type is expected to map to “integer” or “alphabetical”
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#data_type ⇒ Object
readonly
Returns the value of attribute data_type.
-
#implied_decimal_places ⇒ Object
readonly
Returns the value of attribute implied_decimal_places.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#len ⇒ Object
readonly
Returns the value of attribute len.
-
#mnemonic ⇒ Object
readonly
Returns the value of attribute mnemonic.
Instance Method Summary collapse
-
#initialize(params) ⇒ ExtractVariableStub
constructor
A new instance of ExtractVariableStub.
Constructor Details
#initialize(params) ⇒ ExtractVariableStub
Returns a new instance of ExtractVariableStub.
8 9 10 11 12 13 14 15 |
# File 'app/models/extract_variable_stub.rb', line 8 def initialize(params) @mnemonic = params[:mnemonic] or raise "Must set mnemonic." @len = params[:len] or raise "Must set len." @label = params[:label] or raise "Must set label." @data_type = params[:data_type] or raise "Must set data_type." @categories = params[:categories] || [] @implied_decimal_places = params[:implied_decimal_places] || 0 end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
6 7 8 |
# File 'app/models/extract_variable_stub.rb', line 6 def categories @categories end |
#data_type ⇒ Object (readonly)
Returns the value of attribute data_type.
6 7 8 |
# File 'app/models/extract_variable_stub.rb', line 6 def data_type @data_type end |
#implied_decimal_places ⇒ Object (readonly)
Returns the value of attribute implied_decimal_places.
6 7 8 |
# File 'app/models/extract_variable_stub.rb', line 6 def implied_decimal_places @implied_decimal_places end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'app/models/extract_variable_stub.rb', line 6 def label @label end |
#len ⇒ Object (readonly)
Returns the value of attribute len.
6 7 8 |
# File 'app/models/extract_variable_stub.rb', line 6 def len @len end |
#mnemonic ⇒ Object (readonly)
Returns the value of attribute mnemonic.
6 7 8 |
# File 'app/models/extract_variable_stub.rb', line 6 def mnemonic @mnemonic end |