Class: PrestoLegacy::Client::Models::Base
- Inherits:
-
Struct
- Object
- Struct
- PrestoLegacy::Client::Models::Base
- Defined in:
- lib/presto_legacy/client/models.rb
Class Method Summary collapse
Class Method Details
.new(*args) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/presto_legacy/client/models.rb', line 29 def new(*args) new_struct(*args) do # make it immutable undef_method :"[]=" members.each do |m| undef_method :"#{m}=" end # replace constructor to receive hash instead of array alias_method :initialize_struct, :initialize def initialize(params={}) initialize_struct(*members.map {|m| params[m] }) end end end |
.new_struct ⇒ Object
27 |
# File 'lib/presto_legacy/client/models.rb', line 27 alias_method :new_struct, :new |