Class: Maglev::Content::EditorLink

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Attributes, ActiveModel::Model
Defined in:
app/models/maglev/content/editor_link.rb

Instance Method Summary collapse

Instance Method Details

#email=(new_value) ⇒ Object



35
36
37
38
# File 'app/models/maglev/content/editor_link.rb', line 35

def email=(new_value)
  self.href = "mailto:#{new_value}"
  super
end

#persisted?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'app/models/maglev/content/editor_link.rb', line 40

def persisted?
  true
end

#to_component_paramsObject



44
45
46
# File 'app/models/maglev/content/editor_link.rb', line 44

def to_component_params
  as_json['attributes'].with_indifferent_access
end

#url_hrefObject



27
28
29
# File 'app/models/maglev/content/editor_link.rb', line 27

def url_href
  (url_type? && href).presence || ''
end

#url_href=(new_value) ⇒ Object



31
32
33
# File 'app/models/maglev/content/editor_link.rb', line 31

def url_href=(new_value)
  self.href = new_value
end