Class: Bunto::Publisher

Inherits:
Object
  • Object
show all
Defined in:
lib/bunto/publisher.rb

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ Publisher

Returns a new instance of Publisher.



3
4
5
# File 'lib/bunto/publisher.rb', line 3

def initialize(site)
  @site = site
end

Instance Method Details

#hidden_in_the_future?(thing) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/bunto/publisher.rb', line 11

def hidden_in_the_future?(thing)
  thing.respond_to?(:date) && !@site.future && thing.date.to_i > @site.time.to_i
end

#publish?(thing) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/bunto/publisher.rb', line 7

def publish?(thing)
  can_be_published?(thing) && !hidden_in_the_future?(thing)
end