Class: ExtractVariableStub

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#categoriesObject (readonly)

Returns the value of attribute categories.



6
7
8
# File 'app/models/extract_variable_stub.rb', line 6

def categories
  @categories
end

#data_typeObject (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_placesObject (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

#labelObject (readonly)

Returns the value of attribute label.



6
7
8
# File 'app/models/extract_variable_stub.rb', line 6

def label
  @label
end

#lenObject (readonly)

Returns the value of attribute len.



6
7
8
# File 'app/models/extract_variable_stub.rb', line 6

def len
  @len
end

#mnemonicObject (readonly)

Returns the value of attribute mnemonic.



6
7
8
# File 'app/models/extract_variable_stub.rb', line 6

def mnemonic
  @mnemonic
end