Class: Bunto::Publisher
- Inherits:
-
Object
- Object
- Bunto::Publisher
- Defined in:
- lib/bunto/publisher.rb
Instance Method Summary collapse
- #hidden_in_the_future?(thing) ⇒ Boolean
-
#initialize(site) ⇒ Publisher
constructor
A new instance of Publisher.
- #publish?(thing) ⇒ Boolean
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
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
7 8 9 |
# File 'lib/bunto/publisher.rb', line 7 def publish?(thing) can_be_published?(thing) && !hidden_in_the_future?(thing) end |