Class: Mityc::Geoportal::Measure

Inherits:
Object
  • Object
show all
Includes:
HTTParty, HappyMapper
Defined in:
lib/mityc-geoportal/measure.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.fuel_idObject

Returns the value of attribute fuel_id.



63
64
65
# File 'lib/mityc-geoportal/measure.rb', line 63

def fuel_id
  @fuel_id
end

Class Method Details

.by_fuel(fuel_id) ⇒ Object



65
66
67
68
# File 'lib/mityc-geoportal/measure.rb', line 65

def by_fuel(fuel_id)
  self.fuel_id = fuel_id
  @measures ||= self.parse(measures_html)
end

Instance Method Details

#addressObject



47
48
49
# File 'lib/mityc-geoportal/measure.rb', line 47

def address
  @address.strip
end

#amountObject



19
20
21
# File 'lib/mityc-geoportal/measure.rb', line 19

def amount
  @amount.gsub(/,/, ".").to_f
end

#city_nameObject



43
44
45
# File 'lib/mityc-geoportal/measure.rb', line 43

def city_name
  @city_name.strip
end

#data_sourceObject



31
32
33
# File 'lib/mityc-geoportal/measure.rb', line 31

def data_source
  @data_source.strip
end

#marginObject



51
52
53
54
55
56
57
58
59
60
# File 'lib/mityc-geoportal/measure.rb', line 51

def margin
  @margin = @margin.strip
  if @margin =~ /^i$/i
    "left"
  elsif @margin =~/^d$/i
    "right"
  else
    "none"
  end
end

#measured_atObject



23
24
25
# File 'lib/mityc-geoportal/measure.rb', line 23

def measured_at
  @measured_at = self.transform_measured_at
end

#province_nameObject



39
40
41
# File 'lib/mityc-geoportal/measure.rb', line 39

def province_name
  @province_name.strip
end

#public_saleObject



27
28
29
# File 'lib/mityc-geoportal/measure.rb', line 27

def public_sale
  (@public_sale =~/^p$/i)? true : false
end

#scheduleObject



35
36
37
# File 'lib/mityc-geoportal/measure.rb', line 35

def schedule
  @schedule.strip
end