class Geckoboard::MoneyField

Attributes

currency_code[R]

Public Class Methods

new(id, currency_code: nil, **options) click to toggle source
Calls superclass method Geckoboard::OptionalField::new
# File lib/geckoboard/field_types.rb, line 58
def initialize(id, currency_code: nil, **options)
  raise ArgumentError, "`currency_code:' is a required argument" if currency_code.nil?

  super(id, **options)
  @currency_code = currency_code
end

Public Instance Methods

to_hash() click to toggle source
Calls superclass method Geckoboard::OptionalField#to_hash
# File lib/geckoboard/field_types.rb, line 65
def to_hash
  super.merge(type: :money, currency_code: currency_code)
end