Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/activefacts/api/date.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new_instance(constellation, *a) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/activefacts/api/date.rb', line 67

def self.new_instance constellation, *a
  t =
    if a[0].is_a?(Time)
     at(a[0])
    else
     begin
       local(*a)
     end
    end

=begin
  if a[0].is_a?(String)
    parse(*a)
  elsif (a.size == 1)
    case a[0]
    when DateTime
     a[0].clone
    when Date
     civil(a[0].year, a[0].month, a[0].day, 0, 0, 0, a[0].start)
    when NilClass
     civil()
    else
     civil(*a, &b)
    end
  else
    civil(*a, &b)
  end
=end

  t.send(:instance_variable_set, :@constellation, constellation)
  t
end

Instance Method Details

#identifying_role_values(klass = nil) ⇒ Object



63
64
65
# File 'lib/activefacts/api/date.rb', line 63

def identifying_role_values klass = nil
  self
end