Class: Service::ContractBase

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::API, ActiveModel::AttributeMethods, ActiveModel::Attributes, ActiveModel::Validations::Callbacks
Defined in:
lib/service/contract_base.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args, options: nil, **kwargs) ⇒ ContractBase

Returns a new instance of ContractBase.



11
12
13
14
# File 'lib/service/contract_base.rb', line 11

def initialize(*args, options: nil, **kwargs)
  @__options__ = options
  super(*args, **kwargs)
end

Instance Method Details

#optionsObject



16
17
18
# File 'lib/service/contract_base.rb', line 16

def options
  @__options__
end

#raw_attributesObject



24
25
26
# File 'lib/service/contract_base.rb', line 24

def raw_attributes
  @attributes.values_before_type_cast
end

#to_hashObject



20
21
22
# File 'lib/service/contract_base.rb', line 20

def to_hash
  attributes.symbolize_keys
end