Class: Dolarblue::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/dolarblue/configuration.rb

Overview

Singleton configuration class

Instance Method Summary collapse

Instance Method Details

#blue_regexpRegexp

Regular expression to be used to match the Tweet text for ‘blue` value In order to extract the integer value from $1 and the decimal value from $2

Returns:

  • (Regexp)

    the regular expression to be used to match the Tweet text for ‘blue` value



36
37
38
# File 'lib/dolarblue/configuration.rb', line 36

def blue_regexp
  /\$(\d+)[\.,](\d+)/
end

#blue_screen_nameString

Twitter screen name for the ‘blue` dollar value

Returns:

  • (String)

    the twitter screen name for the ‘blue` dollar value



28
29
30
# File 'lib/dolarblue/configuration.rb', line 28

def blue_screen_name
  'DolarBlue'
end

#buy_sell_blue_factorFloat

Default gap factor between the blue sale value vs. the buy value Usually 4.5%

Returns:

  • (Float)

    the percentile between 0..1



21
22
23
# File 'lib/dolarblue/configuration.rb', line 21

def buy_sell_blue_factor
  Float(0.965)
end

#buy_sell_official_factorFloat

Default gap factor between the official sale value vs. the buy value Usually 1.5%

Returns:

  • (Float)

    the percentile between 0..1



13
14
15
# File 'lib/dolarblue/configuration.rb', line 13

def buy_sell_official_factor
  Float(0.985)
end

#card_feeFloat

Dollar “tarjeta” AR fee on top of official value

Returns:

  • (Float)

    the dollar “tarjeta” AR fee to be applied, e.g. 1.2 for an extra 20% charge



58
59
60
# File 'lib/dolarblue/configuration.rb', line 58

def card_fee
  1.2
end

#official_regexpRegexp

Regular expression to be used to match the Tweet text for official value In order to extract the integer value from $1 and the decimal value from $2

Returns:

  • (Regexp)

    the regular expression to be used to match the Tweet text for official value



51
52
53
# File 'lib/dolarblue/configuration.rb', line 51

def official_regexp
  /[Dd]olar: (\d+)[\.,](\d+)/
end

#official_screen_nameString

Twitter screen name for the official (legal) dollar value

Returns:

  • (String)

    the twitter screen name for the official (legal) dollar value



43
44
45
# File 'lib/dolarblue/configuration.rb', line 43

def official_screen_name
  'cotizacionhoyar'
end