module CurateTumblr::Tumblr::Infos
Constants
- HASH_CONFIG_INFOS
- HASH_CONFIG_INFOS_TAGS
- HASH_CONFIG_INFOS_TITLE
Attributes
infos_caption[RW]
infos_title[RW]
state[R]
Public Class Methods
check_infos_config_hash( hash_config )
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 26 def check_infos_config_hash( hash_config ) if hash_config.has_key?( HASH_CONFIG_INFOS ) hash_infos_config = hash_config[HASH_CONFIG_INFOS] # nothing to check now end end
get_infos_config_hash()
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 13 def get_infos_config_hash { HASH_CONFIG_INFOS => { } } end
get_string_yaml_from_infos_config( hash_config )
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 19 def get_string_yaml_from_infos_config( hash_config ) hash_infos_config = hash_config[HASH_CONFIG_INFOS] %Q{ #{Infos::HASH_CONFIG_INFOS}: } end
Public Instance Methods
check_infos_config()
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 52 def check_infos_config end
config_infos( hash_config )
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 44 def config_infos( hash_config ) hash_infos = hash_config[HASH_CONFIG_INFOS] return if hash_infos.nil? @infos_tags = hash_infos[HASH_CONFIG_INFOS_TAGS] if hash_infos.has_key?( HASH_CONFIG_INFOS_TAGS ) @infos_title = hash_infos[HASH_CONFIG_INFOS_TITLE] if hash_infos.has_key?( HASH_CONFIG_INFOS_TITLE ) set_title_caption if !@infos_title.empty? end
get_tumblr_domain()
click to toggle source
— options —
# File lib/curate_tumblr/tumblr/infos.rb, line 57 def get_tumblr_domain @tumblr_name + ".tumblr.com" end
in_published?()
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 77 def in_published? @state == STATE_PUBLISHED end
init_infos!( hash_config={} )
click to toggle source
— config —
# File lib/curate_tumblr/tumblr/infos.rb, line 36 def init_infos!( hash_config={} ) @infos_caption = '' @infos_tags = '' @infos_title = '' @state = STATE_QUEUE config_infos( hash_config ) if !hash_config.empty? end
post_in_draft()
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 65 def post_in_draft @state = STATE_DRAFT end
post_in_private()
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 73 def post_in_private @state = STATE_PRIVATE end
post_in_published()
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 61 def post_in_published @state = STATE_PUBLISHED end
post_in_queue()
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 69 def post_in_queue @state = STATE_QUEUE end
set_title_caption( title="", link="", style_begin="<i>", style_end="</i>", before="<p> </p>", after="")
click to toggle source
# File lib/curate_tumblr/tumblr/infos.rb, line 81 def set_title_caption( title="", link="", style_begin="<i>", style_end="</i>", before="<p> </p>", after="") title = @infos_title if title.empty? raise "no title" if title.empty? link = "http://www.#{@tumblr_name}.tumblr.com" if link.empty? @infos_caption = "#{before}<p><a href='#{link}' target='_blank'>" @infos_caption = @infos_caption + "#{style_begin}" if !style_begin.empty? @infos_caption = @infos_caption + "#{title}" @infos_caption = @infos_caption + "#{style_end}" if !style_end.empty? @infos_caption = @infos_caption + "</a></p>#{after}" end