Class: Recurly::Schema::DateTimeAttribute
Constant Summary
Constants inherited
from Attribute
Attribute::PRIMITIVE_TYPES
Instance Method Summary
collapse
Methods inherited from Attribute
build, #initialize, #recurly_class
Instance Method Details
#cast(value) ⇒ Object
116
117
118
119
120
121
122
|
# File 'lib/recurly/schema.rb', line 116
def cast(value)
if value.is_a?(DateTime)
value
else
DateTime.parse(value)
end
end
|
#is_valid?(value) ⇒ Boolean
112
113
114
|
# File 'lib/recurly/schema.rb', line 112
def is_valid?(value)
value.is_a?(String) || value.is_a?(DateTime)
end
|
#type ⇒ Object
124
125
126
|
# File 'lib/recurly/schema.rb', line 124
def type
DateTime
end
|