lib/delorean/base.rb in delorean_lang-0.3.10 vs lib/delorean/base.rb in delorean_lang-0.3.11

- old
+ new

@@ -20,10 +20,11 @@ sort: [Array], split: [String, String], uniq: [Array], sum: [Array], transpose: [Array], + join: [Array, String], zip: [Array, [Array, Array, Array]], index: [Array, [Object]], product: [Array, Array], first: [Enumerable, [nil, Fixnum]], last: [Enumerable, [nil, Fixnum]], @@ -37,11 +38,11 @@ match: [String, [String], [nil, Fixnum]], hour: [[Date, Time, ActiveSupport::TimeWithZone]], min: [[Date, Time, ActiveSupport::TimeWithZone, Array]], sec: [[Date, Time, ActiveSupport::TimeWithZone]], - to_date: [[Date, Time, ActiveSupport::TimeWithZone]], + to_date: [[Date, Time, ActiveSupport::TimeWithZone, String]], month: [[Date, Time, ActiveSupport::TimeWithZone]], day: [[Date, Time, ActiveSupport::TimeWithZone]], year: [[Date, Time, ActiveSupport::TimeWithZone]], @@ -145,10 +146,10 @@ if obj.instance_of?(Hash) || obj.kind_of?(ActiveRecord::Base) || obj.instance_of?(NodeCall) || obj.instance_of?(Class) raise InvalidIndex unless args.length == 1 _get_attr(obj, args[0], _e) - elsif obj.instance_of?(Array) + elsif obj.instance_of?(Array) || obj.instance_of?(String) raise InvalidIndex unless args.length <= 2 raise InvalidIndex unless args[0].is_a?(Fixnum) && (!args[1] || args[1].is_a?(Fixnum)) obj[*args] else