Class: Pipio::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/pipio/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata_hash) ⇒ Metadata

Returns a new instance of Metadata.



3
4
5
6
7
8
# File 'lib/pipio/metadata.rb', line 3

def initialize()
  @service = [:service]
  @my_screen_name = normalize_screen_name([:my_screen_name])
  @their_screen_name = [:their_screen_name]
  @start_time = [:start_time]
end

Instance Attribute Details

#my_screen_nameObject (readonly)

Returns the value of attribute my_screen_name.



10
11
12
# File 'lib/pipio/metadata.rb', line 10

def my_screen_name
  @my_screen_name
end

#serviceObject (readonly)

Returns the value of attribute service.



10
11
12
# File 'lib/pipio/metadata.rb', line 10

def service
  @service
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



10
11
12
# File 'lib/pipio/metadata.rb', line 10

def start_time
  @start_time
end

#their_screen_nameObject (readonly)

Returns the value of attribute their_screen_name.



10
11
12
# File 'lib/pipio/metadata.rb', line 10

def their_screen_name
  @their_screen_name
end

Instance Method Details

#start_mdayObject



24
25
26
# File 'lib/pipio/metadata.rb', line 24

def start_mday
  @start_time.mday
end

#start_monthObject



20
21
22
# File 'lib/pipio/metadata.rb', line 20

def start_month
  @start_time.mon
end

#start_yearObject



16
17
18
# File 'lib/pipio/metadata.rb', line 16

def start_year
  @start_time.year
end

#valid?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/pipio/metadata.rb', line 12

def valid?
  [@their_screen_name, @my_screen_name, @start_time, @service].all?
end