Class: Mityc::Geoportal::Measure
- Inherits:
-
Object
- Object
- Mityc::Geoportal::Measure
- Includes:
- HTTParty, HappyMapper
- Defined in:
- lib/mityc-geoportal/measure.rb
Class Attribute Summary collapse
-
.fuel_id ⇒ Object
Returns the value of attribute fuel_id.
Class Method Summary collapse
Instance Method Summary collapse
- #address ⇒ Object
- #amount ⇒ Object
- #city_name ⇒ Object
- #data_source ⇒ Object
- #margin ⇒ Object
- #measured_at ⇒ Object
- #province_name ⇒ Object
- #public_sale ⇒ Object
- #schedule ⇒ Object
Class Attribute Details
.fuel_id ⇒ Object
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
#address ⇒ Object
47 48 49 |
# File 'lib/mityc-geoportal/measure.rb', line 47 def address @address.strip end |
#amount ⇒ Object
19 20 21 |
# File 'lib/mityc-geoportal/measure.rb', line 19 def amount @amount.gsub(/,/, ".").to_f end |
#city_name ⇒ Object
43 44 45 |
# File 'lib/mityc-geoportal/measure.rb', line 43 def city_name @city_name.strip end |
#data_source ⇒ Object
31 32 33 |
# File 'lib/mityc-geoportal/measure.rb', line 31 def data_source @data_source.strip end |
#margin ⇒ Object
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_at ⇒ Object
23 24 25 |
# File 'lib/mityc-geoportal/measure.rb', line 23 def measured_at @measured_at = self.transform_measured_at end |
#province_name ⇒ Object
39 40 41 |
# File 'lib/mityc-geoportal/measure.rb', line 39 def province_name @province_name.strip end |
#public_sale ⇒ Object
27 28 29 |
# File 'lib/mityc-geoportal/measure.rb', line 27 def public_sale (@public_sale =~/^p$/i)? true : false end |
#schedule ⇒ Object
35 36 37 |
# File 'lib/mityc-geoportal/measure.rb', line 35 def schedule @schedule.strip end |