Class: IActionable::Objects::IActionableObject
- Inherits:
-
Object
- Object
- IActionable::Objects::IActionableObject
show all
- Defined in:
- lib/iactionable/objects/i_actionable_object.rb
Direct Known Subclasses
Achievement, Challenge, Goal, Identifier, Leaderboard, LeaderboardReport, Level, LevelType, PointType, ProfileAchievements, ProfileChallenges, ProfileGoals, ProfileLevel, ProfileNotifications, ProfilePoints, ProfileSummary, Progress
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
4
5
6
7
8
|
# File 'lib/iactionable/objects/i_actionable_object.rb', line 4
def initialize(key_values={})
key_values.each_pair do |key, value|
instance_variable_set "@#{key.camelize.underscore}".to_sym, value
end
end
|
Class Method Details
.timestamp_regexp ⇒ Object
10
11
12
|
# File 'lib/iactionable/objects/i_actionable_object.rb', line 10
def self.timestamp_regexp
/\/Date\((\d+)((\-|\+)\d{4})\)\//
end
|
.timestamp_to_seconds(timestamp) ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'lib/iactionable/objects/i_actionable_object.rb', line 14
def self.timestamp_to_seconds(timestamp)
milliseconds = timestamp[timestamp_regexp, 1]
tz = timestamp[timestamp_regexp, 2]
unless milliseconds.nil? || tz.nil?
"#{Integer(milliseconds)/1000}#{tz}"
else
nil
end
end
|